Override lifecycle

Hi,
We are looking for a way to standardize the way ADF shows errors/warnings to the user.
When the error is thrown in Business Components, it is shown in a popup. We've customized the messages with a Custom error handler (reportException & getDisplayMessage methods).
When the error is thrown in a backin bean and it is controlled (caught), we can show in the same way as before (FacesMessage and af:messages tag).
The problem is when the error in the backing bean is not controlled, i.e. a NullPointerException.
I know it can be caught without problems, with a try/catch block inside the backing bean, but I'm working in providing a framework to facilitate the development (some common components like exception handling and templates), and I can't be 100% sure all possible exceptions will be controlled. So I want to put a try/catch blog in the backing bean caller, that is the lifecycle execute(). This is something possible in JSF and even in ADF10g (I think), but I can't find anything related in ADF11g.
Any clue appreciated.
Environment is JDev 11g R1.
Thanks in advance,
Roger

Hello,
and thanks for your help.
Meanwhile I created a Custom PagePhaseListener with PhaseListener Interface and registered it on the JSPX <f:phaseListener binding="..."/>
This matches my requirements even better since I need a listener for only one JSPX.
Since this is a JSF (not ADF) Interface I only get the Standard Lifecycle-Phases, which are fewer than in Frank's example, but they are sufficient for my purposes.
Or do you see any other major drawbacks.
Bruno

Similar Messages

  • Override lifecycle event-handler in 11g

    Hello,
    I am trying to override lifecycle event-handling in 11g environment with the standard ADFPhaseListener.
    In faces-config.xml I registered:
    <lifecycle>
    <phase-listener>oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener</phase-listener>
    </lifecycle>
    I have a backing-bean that extends oracle.adf.controller.v2.lifecycle.PageController
    and override some methods like
    @Override
    public void prepareModel(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.prepareModel(lifecycleContext);
    @Override
    public void prepareRender(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.prepareRender(lifecycleContext);
    @Override
    public void processComponentEvents(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.processComponentEvents(lifecycleContext);
    @Override
    public void processUpdateModel(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.processUpdateModel(lifecycleContext);
    If I set breakpoints in all 4 methods however they are never matched, not when entering the page nor during roundtrips.
    Is there anything else I have to do to make it work. I couldn't find a detailed example for 11g.
    Bruno

    Hello,
    and thanks for your help.
    Meanwhile I created a Custom PagePhaseListener with PhaseListener Interface and registered it on the JSPX <f:phaseListener binding="..."/>
    This matches my requirements even better since I need a listener for only one JSPX.
    Since this is a JSF (not ADF) Interface I only get the Standard Lifecycle-Phases, which are fewer than in Frank's example, but they are sufficient for my purposes.
    Or do you see any other major drawbacks.
    Bruno

  • ADF BC/Faces - Order of validation / backing bean action problem

    Hello,
    I want the user to enter the same "operation date" into all adf faces table rows created in one batch (one transaction).
    So I removed operation date field from the table and added "unbound" date field above the table. The date field value is then copied into all new rows in background. This process is invoked from backing bean from Commit button actionListener method.
    The problem is the validation of the operation date in entity is executed before a new date value is copied into the date attribute (validation of model is in JSF lifecycle executed prior invoking actions in backing beans).
    It means the user can enter dead lock when he enters invalid date (for example date higher then a valid value).
    Then after commit:
    1. First validation is ok (wrong date value haven't been copied into model yet)
    2. backing bean copy action is executed - model now contains wrong date value
    3. Validation before commit isn't successfult - error message is displayed
    4. User corrects the date value and presses commit again but:
    5. First validation is not successful - model still contains recent wrong date value - error message is displayed again
    6.There is no way out from this situation
    I'm going to override lifecycle to be able to invoke copy method before validation cycle. Is this solution acceptable? Do you have any other suggestion?
    Thank you.
    Rado

    hi Rado
    Would it make sense to design your ADF BC View Objects in some kind of master-detail shape that fits your data?
    View Object : OperationMaster (OperationDateAttr, ...)
    View Object : OperationDetail (OperationAttr1, OperationAttr2, ...)
    View Link : OperationDetailForMasterVL (based on some attribute that keeps the detail rows together)
    You would need some Application Module method that does the "row batch setup", but it look like your already have something like this.
    A change to OperationMaster.OperationDateAttr could update all its detail rows date attribute.
    I think that building a UI on this would be less "view layer dependant".
    Just a suggestion.
    regards
    Jan Vervecken

  • Not in JDeveloper: Lifecycle PhaseListener best practice for a single page?

    ADF Faces 10.1.3.2
    * Not using JDeveloper *
    Two questions:
    I need to add logic to the lifecycle for one page and not all of the pages in the application.
    1.) What is the best practice to write a Lifecycle PhaseListener for a single page?
    I understand that I need to extend the PageController class and override the methods I want to change, then use the new page controller in your pages.
    I'm referencing:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=adf_plifecyclehandlejsf_html
    2.) Since I'm not using JDeveloper, how to I use the PageController class?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Frank: Please let me clairfy.
    I am using ADF Faces, just not using the JDeveloper IDE to develop the application.
    I am using Netbeans 5.5.1.
    So going back to my question, after extending the PageController, how to I make that class a part of my application in Java code, faces-config.xml or adf-faces-config.xml?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Overriding spring configuration in J2EE deployment plan?

    I would like some suggestions on how to solve this problem:
    Background:
    We are developing an application with a web interface and a couple of EJB's, which will be deployed on WebLogic 9.2. We are using Spring 1.2.8. We are using a ContextSingletonBeanfactoryLocator to have a shared application context between the web app and the EJB's.
    We have some configuration values (server names, URLs, directories etc), which we would like to modify at deployment time, depending on the environment (local/dev/test/uat/prod). However, we definitely do not want to build different .ear files for each environment.
    The problem:
    The normal way to do this (when not using spring) is to place these in a deployment descriptor (e.g. web.xml or ejb-jar.xml) and then override them with a deployment plan at deployment time. But a deployment plan cannot override values in an arbitrary file (such as applicationContext.xml)
    Approach A:
    I use a PropertyPlaceholderConfigurer or similar to load an "c:\myapp.environment.properties" file, which was placed in the filesystem outside of the ear, and which was different in all environments. This is simple to implement, but in a distributed environment with many servers and many applications, it will be a pain to maintain this file.
    Approach B:
    Much like approach A, but put the property file in a separate application library and load it from the classpath. Then maintain a different version of this app library for each environment. This makes it simpler to ensure it's deployed to all managed servers - but it's a bit more complicated to maintain.
    Approach C:
    Use an extended ContextLoaderListener servlet so that it automatically deployed a PropertyPlaceholderConfigurer bean which expanded all context-params. E.g.
    <pre>
    <!-- web.xml -->
    <context-param>
    <param-name>remoteServerName</param-name>
    <param-value>myRemoteServerInDev</param-value>
    </context-param>
    <context-param>
    <param-name>fileDirectory</param-name>
    <param-value>c:\files</param-value>
    </context-param>
    <listener>
    <listener-class>
    dk.pfa.ConfiguringContextLoaderListener
    </listener-class>
    </listener>
    </pre>
    In my applicationContext.xml, I would then have <property name="serverName" value="${remoteServerName}"/>
    For production, I could override the web.xml in the deployment plan to set remoteServerName to "prodRemoteServer".
    The problem is that I cannot be sure that this servlet actually gets to configure the shared application context - an EJB may initialise first.
    I could put similar logic in each and every EJB, using <env-entry> in ejb-jar.xml instead of <context-param> in web.xml. This seems to invite trouble, since I would then have to ensure that the deployment plan had overridden values for all these entries as well .
    Finally I have the option of making an application lifecycle listener class - but that cannot access the web.xml, ejb-jar.xml or any other deployment-plan-overridable files, where I can put user-defined values .
    So what is the best practice? Or just a reasonable approach?
    Surely, I cannot be the first to face this problem, but if somebody has solved it, they forgot to mention it to Google

    I would vote for A or B

  • Insert Only Forms with custom Page Lifecycle class

    I discovered a bug/inconsistency in the JHS Generator:
    The business case (translated to the HR schema) is
    We have an Insert Only form for creating new Departments. (Group name: DepartmentsEntry)
    When the user saves a new Department, we want to forward them
    using the Faces Navigation Handler to the group named "Departments".
    The implementation we used:
    - Create a custom class which extends oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.
    This class overrides the onCommit method: if there are errors we stay on this page,
    otherwise we redirect the user.
    - Specify this classname in the Page Lifecycle Class property (under "Customization Settings") within the Application Definition Editor.
    When we then try to run the page, the Insert-Only form does not work as expected;
    The user has to click on the "New Department" button first.
    I see that the specified classname occurs in the ControllerClass property of
    the Page Definition file DepartmentsEntryPageDef.xml file.
    The way I solved the problem was to create a custom groupFacesConfig.vm template
    which specifies the managed-bean-class property of the ${JHS.current.group.name}PageLifecycle managed bean.
    This then solves the problem - the InsertOnly form works as expected.
    This is not as I would expect the "Page Lifecycle Class" property to be used.
    In my opinion the "Page Lifecycle Class" property should also be used in the default groupdFacesConfig.vm template and not only in the Page Definition file.
    Is this behaviour expected?

    Cliff,
    You are right, this is a bug that has been fixed for the upcoming 10.1.3.2 release.
    Steven Davelaar,
    JHeadstart Team.

  • Override JBOException

    Hello,
    I am new at java / jdeveloper and I am trying to override a JBOException. It is thrown when I want to delete a master record, which still has detail records. This is a good thing, but I want to change the default message. I looked into the CSMessageBundle to look up the errorcode, since it isn't shown in the stack or on the JSP. I couldn't find the right errorcode, so I can't use my own MessageBundle.
    I'm wondering, can I override this message through my own MessageBundle?
    I have JDev version 10.1.2 and JHeadstart, which I use to generate JSP's with.
    Thanks in advance!
    This is the errorstack:
    oracle.jbo.JboException: Error Cannot delete Vvb Patches while dependent Vvb Procesobjecten exists: Cannot delete Vvb Patches while dependent Vvb Procesobjecten exists
         at oracle.jbo.JboException.<init>(JboException.java:333)
         at oracle.jheadstart.model.adfbc.RuleFrameTransactionImpl.getMessageStack(RuleFrameTransactionImpl.java:188)
         at oracle.jheadstart.model.adfbc.RuleFrameTransactionImpl.handleSQLError(RuleFrameTransactionImpl.java:135)
         at oracle.jheadstart.model.adfbc.RuleFrameTransactionImpl.postChanges(RuleFrameTransactionImpl.java:77)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1922)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2115)
         at oracle.jheadstart.model.adfbc.RuleFrameTransactionImpl.commit(RuleFrameTransactionImpl.java:113)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:962)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1215)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:954)
         at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.onCommit(JhsDataAction.java:1579)
         at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.onDelete(JhsDataAction.java:1335)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
         at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
         at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:477)
         at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:236)
         at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:126)
         at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
         at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.handleLifecycle(JhsDataAction.java:389)
         at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
         at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:765)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:172)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)

    Hi,
    hard to tell from the error messages you copied and paste. What is in the prepare session override ? Make sure that either at the beginning or at the end you call the super classes prepare session
    Frank

  • To Override Project Coding Mask

    Dear All,
    At present, we have coding mask in system where the Project ID= Company code
    For example For ABCD Project ID , coding mask is -XXX-XX-0000-XXXXXXX, and ABCD is also a  company code.
    The new requirement is to have Project Def such as ABCDP0001234, without any special characters, where ABCD is company code.
    How can I override the existing coding mask for creating new Project Def, for say, a new Project profile.
    Is there any user exit available for this?
    Regards,
    Manmay Mallick

    hello
    What you can do:
    1. You can delete all projects and change mask and import them again to system. Of course it means that you need to do a huge project for this with CO/MM/FI/SD consultants. That's a very cost consumable event but ... you will have data as you wish. I am not sure if that is worth it.
    2. Simples way but a little longer but low costs.
    You need to check 1 checkbox, in transaction OPSK check if you have Edit checkbox checked. If not that means you can create project outside the range of project number defined according to your project mask.
    Eg. if you have only 1 mask
    ABCD-XXX-XX-0000-XXXXXXX, you create project ABCD-EFG-KK-1234-ASD1234
    if Edit checkbox is not checked you can create project eg WD12123332/2233-112-1212 but what is important you mustn't have any validation that check a project number and your new project number range doesn't start with ABCD chars. Check it yourself.
    So if you stop using ABCD project mask and start using new coding project range as you almost want
    ABCDP0001234 - but one char in ABCD must be change for a period of time you will use
    0BCDP0001234 number. In other way the system will check it according to your ABCD mask.
    When the time will come and projects with old number will go out and you will have only few of them activelu maintain you will make a decision to migrate the few old projects to new number 0ABC.
    After that move you will need to archive old projects and remove them from your database then you can delete a mask ABCD. If you delete this old mask all your projects can be renumerate to your number expectation from 0BCDP0001234 to ABCDP0001234. And you got it
    What are the costs of this solution:
    1. Organizational decision to use new codings of projects 0BCD for period of time.
    2. Prepare a few validation to check the project number if you don't use mask you need to have any mechanizm to verify correctness of your project numbers.
    3. Small migration of few old projects to new ones.
    4. Archive of old projects.
    5. Small LSMW to renumerate 0BCD projects to ABCD projects.
    When to do it?
    It depends of your organization and the lifecycle of your projects.
    Additional info
    For a period of time in your old projects you can use Mask ID field in project definition and put there + sign in the place which char schould be used to find WBS element in the system as an alternative way.
    Eg.
    You have a WBS element ABCD-EFG-KK-1234-ASD1234
    on the definition of this project in Mask ID put ++++_+++_++_++++_+++++++ where _ means space. In such a way on you WBS element in the field Short ID you will get ABCDEFGKK1234ASD1234 and this number can be used in reports etc.
    Hope this help

  • How To Make mozilla.cfg, override.ini, all-companyname.js, Files To Work Once And For All For All Users

    I'm currently trying to apply a fix to the firefox browser (version 23.0.1) on over 250 computers. Setting default webpages, disabling annoying prompts like the default browser and importing bookmarks, and erasing the history on shutdown, or startup. This is very easily done modifying the pref.js file, but I will not edit that file, it's out of the question. Another FF update will erase or overwrite all of my modifications.
    I run a computer lab in the university that is locked down using a Net Support School console. You don't need to look that up. Basically all websites are restricted except the ones the ones I whitelist. The websites we use have extensive API's for JS, CSS, Java, PHP, etc... We utilize technology in order for students to use graphing calculators, video's, and taking module test from these white-listed websites, like Pearson, or Aleks. Now with that said, cookies, and stored profile history become a problem, and on some day's up to 25% of the students using the computers need their entire history deleted in order for a page to load. I think I fixed this problem permanently by whitelisting backend sites importing plugins, and API's etc, that I found from the developers console. Whatever. What I've learned from all of this is that Firefox can be very customizable utilizing the "...\Mozilla Firefox\mozilla.cfg" and the "...\Mozilla Firefox\defaults\prefs\all-companyname.js" (or custom.js) The problem, is no matter what I try I can't get these to work. The closest I got was here:
    http://www.intrntpirate.com/?p=615
    Again, even that ^^ didn't work. I followed these directions to a "T". What is wrong with the above information provided in the link? Why is firefox making harder and harder for us to optimize it for massive deployments across a corporation and a university? I'm not going to do any fancy hacks to avoid the main issue. I need mozilla.cfg, and the all-companyname.js, and the override.ini files to work, if and only if they are still relevant.
    These are what my files look like so far:
    name: all-lmc.js<br />
    location: C:\Program Files (x86)\Mozilla Firefox\defaults\pref\<br />
    pref("general.config.filename", "mozilla.cfg");<br />
    pref("browser.startup.homepage", "https://(some url)");<br />
    name: override.ini<br />
    location: C:\Program Files (x86)\Mozilla Firefox\<br />
    [XRE]<br />
    EnableProfileMigrator=false<br />
    <br />
    name: mozilla.cfg<br />
    location: C:\Program Files (x86)\Mozilla Firefox\<br />
    //<br />
    lockPref("privacy.sanitize.sanitizeOnShutdown", true);<br />
    lockPref("privacy.sanitize.promptOnSanitize", false);<br />
    lockPref("browser.shell.checkDefaultBrowser", false);<br />
    lockPref("toolkit.telemetry.enabled", false);<br />
    lockPref("toolkit.telemetry.prompted", 2);<br />
    lockPref("toolkit.telemetry.rejected", true);
    I've tried using, and not using, the automatic mozilla configurator. I've tried changing lockPref to pref. Nothing works. Not the override.ini, not the all-lmc.js, and not the mozilla.cfg. I've wasted hours reading through blogs of experts telling us to modify files that don't exist, or beating around the bush. I'm done researching. If you have the answer or want to help me figure this out just remember to keep it simple. Please. I ultimately want to package all the config files, with a how to, in a zip folder onto our shared drive. To have FF customized and ready to deploy to different departments across campus.

    Thanks very much for your help, but I'm still overlooking something. I double checked to make sure that I did not have a hidden .txt file extention. I then decided to abandon the lock on preferences idea until I get it working. I converted my mozilla.cfg file back to plain text. I made sure I do not have an extra blank line at the end of each file. The syntax looks good, as far as I can tell. I'll copy and paste what I have so far. Did I have the file locations correct posted above? Also, if you feel i can delete some lines of text in my mozilla.cfg file I'll be happy to do so.
    mozilla.cfg
    <pre><nowiki>//
    pref("privacy.sanitize.sanitizeOnShutdown", true);
    pref("privacy.sanitize.promptOnSanitize", false);
    pref("browser.rights.override", true);
    pref(“app.update.auto”, false);
    pref(“extensions.blocklist.enabled”, false);
    pref(“extensions.shownselectionUI”, true);
    pref(“browser.shell.checkDefaultBrowser”, false);
    pref(“toolkit.telemetry.enabled”, false);
    pref(“toolkit.telemetry.prompted”, 2);
    pref(“toolkit.telemetry.rejected”, true);
    pref(“app.update.auto”, false);
    pref(“browser.download.useDownloadDir”, true);
    pref(“browser.search.update”, false);
    pref(“signon.autofillForms”, false);
    pref(“signon.rememberSignons”, false);
    pref(“browser.download.manager.scanWhenDone”, true);
    pref(“browser.formfill.enable”, false);
    pref(“xpinstall.enabled”, true);</nowiki></pre>
    channel-prefs.js
    pref("app.update.channel", "release");
    override.ini
    [XRE]
    EnableProfileMigrator=false
    all-lmc.js
    pref("general.config.filename", "mozilla.cfg");
    defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=http://bbc.co.uk");
    Again, thank you very much for your time. Do I create my own browserconfig.properties, and firefox.js? Also, I forgot to mention I'm running Windows 8.

  • Overriding attributes in ABAP objects

    Hello,
    I currently want know if it is possible to override attributes in ABAP objects. i know it is possible with methods. I have extend a previous class functionality and want to change the refrence type of an attribute from the parent class, but only on the child. Is this possible in ABAP object or even in normal object oriented techniques.
    Thanks
    Brendan

    Hi,
    ususally you can achive this with other technics. You can e.g. use the class hierarchy for this:
    The attribute is of type REF_SUPERCLASS. Within the superclass it should be working when you set subclasses of REF_SUPERCLASS as attribute.
    Another way is to use interfaces as reference type for your attribute.
    Please refer to [ABAP Objects|http://help.sap.com/saphelp_nw70/helpdata/EN/ce/b518b6513611d194a50000e8353423/frameset.htm]. Especially the chapters about Inheritance and Interfaces.
    Regards Rudi

  • Screen saver overrides iTunes cover flow in Lion

    On my new iMac (OSX 10.7.1, iTunes 10.4.1), when in full screen cover flow mode, the screen saver overrides this, which is annoying as I like to leave it playing with the artwork displayed. This did not happen on my old (Leopard) Mac. I can't find any preference setting that seems to fix this. I dont really want to turn off the screen saver - I didn't have to before, why now?

    Have you tried creating a hot corner (System Preferences > Desktop & Screen Saver > Screen Saver - Hot Corners) to disable the screen saver by parking mouse pointer in the "hot corner."
    I'm assuming Lion still has this function.

  • Is not abstract and does not override abstract method actionPerformed

    I dont how to corr. Please help!! and thank you very much!!
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class test extends JFrame implements ActionListener, ItemListener
              private CenterPanel centerPanel;
              private QuestionPanel questionPanel;
              private ButtonPanel buttonPanel;
              private ResponsePanel responsePanel;
              private JButton b1,b2,b3,b4,b5;               //Create five references to Jbutton instances
         private JTextField t1,t2,t3,t4,t5;          //Create five references to JTextField instances
              private JLabel label1;                    //Create one references to JLabel instances
              private JRadioButton q1,q2,q3;               //Create three references to JRadioButton instances
              private ButtonGroup radioGroup;               //Create one references to Button Group instances
              private int que1[] = new int[5];           //Create int[4] Array
              private int que2[] = new int[5];
              private int que3[] = new int[5];
              private String temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10,
                        temp11, temp12, temp13, temp14, temp15;
    public test (String header)
              super(header);
              Container container = getContentPane();
              label1 = new JLabel ("PLease click on your response to ");     
              q1 = new JRadioButton("I understand most of the content of this subject",true);
              add(q1);
              q2 = new JRadioButton("I see the relevance of the subject to my degree",false);
              add(q2);
              q3 = new JRadioButton("The workload in this subject is appropriate",false);
              add(q3);
              radioGroup = new ButtonGroup();               //JRadioButton belong to ButtonGroup
              radioGroup.add(q1);
              radioGroup.add(q2);
              radioGroup.add(q3);
              JPanel buttonPanel = new JPanel();
              JPanel responsePanel = new JPanel();
              JPanel questionPanel = new JPanel();
              JPanel centerPanel = new JPanel();
              b1 = new JButton ("Strongly DISAGREE");          //Instantiate JButton with text
              b1.addActionListener (this);               //Register JButtons to receive events
              b2 = new JButton ("DISAGREE");
              b2.addActionListener (this);
              b3 = new JButton ("Neither AGREE or DISAGREE");
              b3.addActionListener (this);
              b4 = new JButton ("AGREE");
              b4.addActionListener (this);
              b5 = new JButton ("Strongly AGREE");
              b5.addActionListener (this);
              buttonPanel.setLayout(new GridLayout(5,1));
              buttonPanel.add(b1);
              buttonPanel.add(b2);
              buttonPanel.add(b3);
              buttonPanel.add(b4);
              buttonPanel.add(b5);
              t1 = new JTextField ("0",3);               //JTextField contains empty string
              t2 = new JTextField ("0",3);
              t3 = new JTextField ("0",3);
              t4 = new JTextField ("0",3);
              t5 = new JTextField ("0",3);
              t1.setEditable( false );
              t2.setEditable( false );
              t3.setEditable( false );
              t4.setEditable( false );
              t5.setEditable( false );
              responsePanel.setLayout(new GridLayout(5,1));
              responsePanel.add(t1);
              responsePanel.add(t2);
              responsePanel.add(t3);
              responsePanel.add(t4);
              responsePanel.add(t5);
              questionPanel.setLayout(new GridLayout(4,1));
              questionPanel.add(label1);
              questionPanel.add(q1);
              questionPanel.add(q2);
              questionPanel.add(q3);
              centerPanel.add(buttonPanel,BorderLayout.CENTER);
              centerPanel.add(responsePanel,BorderLayout.EAST);
              container.add(centerPanel,BorderLayout.WEST);
              container.add(questionPanel,BorderLayout.NORTH);
              q1.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que1[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp1 = String.valueOf(que1[0]);
              t1.setText(temp1);
              else if (e.getSource() == b2)     {
                   que1[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp2 = String.valueOf(que1[1]);
              t2.setText(temp2);
              else if (e.getSource() == b3)     {
                   que1[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp3 = String.valueOf(que1[2]);
              t3.setText(temp3);
              else if (e.getSource() == b4)     {
                   que1[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp4 = String.valueOf(que1[3]);
              t4.setText(temp4);
              else if (e.getSource() == b5)     {
                   que1[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp5 = String.valueOf(que1[4]);
              t5.setText(temp5);
    } //end action performed
              q2.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que2[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp6 = String.valueOf(que2[0]);
              t1.setText(temp1);
              else if (e.getSource() == b2)     {
                   que2[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp7 = String.valueOf(que2[1]);
              t2.setText(temp7);
              else if (e.getSource() == b3)     {
                   que2[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp8 = String.valueOf(que2[2]);
              t3.setText(temp8);
              else if (e.getSource() == b4)     {
                   que2[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp9 = String.valueOf(que2[3]);
              t4.setText(temp9);
              else if (e.getSource() == b5)     {
                   que2[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp10 = String.valueOf(que2[4]);
              t5.setText(temp10);
    } //end action performed
              q3.addActionListener(
                   new ActionListener(){
              public void actionPerformed( ActionEvent e )          
    {                                        //actionPerformed of all registered listeners
              if (e.getSource() == b1) {
                   que3[0] = Integer.parseInt(t1.getText()) + 1;
                   String temp11 = String.valueOf(que3[0]);
              t1.setText(temp11);
              else if (e.getSource() == b2)     {
                   que3[1] = Integer.parseInt(t2.getText()) + 1;
                   String temp12 = String.valueOf(que3[1]);
              t2.setText(temp12);
              else if (e.getSource() == b3)     {
                   que3[2] = Integer.parseInt(t3.getText()) + 1;
                   String temp13 = String.valueOf(que3[2]);
              t3.setText(temp13);
              else if (e.getSource() == b4)     {
                   que3[3] = Integer.parseInt(t4.getText()) + 1;
                   String temp14 = String.valueOf(que3[3]);
              t4.setText(temp14);
              else if (e.getSource() == b5)     {
                   que3[4] = Integer.parseInt(t5.getText()) + 1;
                   String temp15 = String.valueOf(que3[4]);
              t5.setText(temp15);
    } //end action performed
    }//end constructor test
    public void itemStateChanged(ItemEvent item) {
    //int state = item.getStateChange();
    //if (q1 == item.SELECTED)
              public class ButtonPanel extends JPanel
                   public ButtonPanel()
              public class CenterPanel extends JPanel
                   public CenterPanel()
              public class QuestionPanel extends JPanel
                   public QuestionPanel()
              public class ResponsePanel extends JPanel
                   public ResponsePanel()
    public static void main(String [] args)
         test surveyFrame = new test("Student Survey") ;
         surveyFrame.setSize( 500,300 );
         surveyFrame.setVisible(true);
         surveyFrame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
         }//end main
    }//end class test

    is not abstract and does not override abstract method actionPerformed
    Oh, I see that the title of your post is an error message? Ok. Well, the test class is declared as implementing an ActionListener. That means the test class must have an actionPerformed() method. Your test class apparently does not.
    It does not appear that the test class needs to implement ActionListener. You are using annonymous classes as listeners.

  • Is not abstract and does not override abstract method tablechanged

    I will remove all the gui code to make it shorter, but my problem lies with my InteractiveTableModelListener.
    public class Meet extends JPanel{
      private static void createAndShowGUI() {
            JFrame frame = new JFrame("MEET_dataTable");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(new Meet(), BorderLayout.CENTER);
            frame.pack();
            frame.setVisible(true);
    public class InteractiveTableModelListener implements TableModelListener {
         public void TableChanged(TableModelEvent evt) {
      if (evt.getType() == TableModelEvent.UPDATE) {
          int column = evt.getColumn();
          int row = evt.getFirstRow();
          dataTable.setColumnSelectionInterval(column + 1, column + 1);
          dataTable.setRowSelectionInterval(row, row);
    class InteractiveRenderer extends DefaultTableCellRenderer {
      protected int interactiveColumn;
      public InteractiveRenderer(int interactiveColumn) {
          this.interactiveColumn = interactiveColumn;
    public Component getTableCellRendererComponent(JTable dataTable,
         Object value, boolean isSelected, boolean hasFocus, int row,
         int column)
      Component c = super.getTableCellRendererComponent(dataTable, value, isSelected, hasFocus, row, column);
       if (column == interactiveColumn && hasFocus) {
         if ((Meet.this.tableModel.getRowCount() - 1) == row &&
            !Meet.this.tableModel.hasEmptyRow())
             Meet.this.tableModel.addEmptyRow();
        highlightLastRow(row);
      return c;
    public void highlightLastRow(int row) {
         int lastrow = tableModel.getRowCount();
      if (row == lastrow - 1) {
          dataTable.setRowSelectionInterval(lastrow - 1, lastrow - 1);
      else {
          dataTable.setRowSelectionInterval(row + 1, row + 1);
         dataTable.setColumnSelectionInterval(0, 0);
    public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                UIManager.put("swing.boldMetal", Boolean.FALSE);
                createAndShowGUI();
    }As i say, i have removed all the gui code to make it shorter, but in this code i create the table and add all the model to it. I am being returned with the error
    Meet.InteractiveTableModelListener is not abstract and does not override abstract method tableChanged(javax.swing.event.TableModelEvent)in javax.swing.event.TableModelListener
    what would be causing this error?
    Cheers

    Sorry, just figured out my silly error, the method is tableChanged not TableChanged.
    cheers
    TOPIC CLOSED
    Edited by: nick2price on Sep 11, 2008 7:08 AM

  • Is not abstract and does not override abstract method ERROR

    Hello. I'm new at all this, and am attempting to recreate a sample code out of my book (Teach Yourself XML in 24 Hours), and I keep getting an error. I appriciate any help.
    This is the Error that I get:
    DocumentPrinter is not abstract and does not override abstract method skippedEntity(java.lang.String) in org.xml.sax.ContentHandler
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
            ^This is the sourcecode:
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
    // A Constant containing the name of the SAX parser to use.
    private static final String PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
    public static void main(String[] args)
       // Check to see whether the user supplied any command line arguments.  If not, print an error and exit.
       if (args.length == 0)
         System.out.println("No XML document path specified.");
         System.exit(1);
       // Create a new instance of the DocumentPrinter class.
       DocumentPrinter dp = new DocumentPrinter();
       try
         // Create a new instance of the XML Parser.
         XMLReader parser = (XMLReader)Class.forName(PARSER_NAME).newInstance();
         // Set the parser's content handler
        // parser.setContentHandler(dp);
         // Set the parsers error handler
         parser.setErrorHandler(dp);
         // Parse the file named in the argument
         parser.parse(args[0]);
       catch (Exception ex)
         System.out.println(ex.getMessage());
         ex.printStackTrace();
    public void characters(char[] ch, int start, int length)
       String chars ="";
       for (int i = start; i < start + length; i++)
         chars = chars + ch;
    System.out.println("Recieved characters: " + chars);
    public void startDocument()
    System.out.println("Start Document.");
    public void endDocument()
    System.out.println("End of Document.");
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    System.out.println("Start element: " + localName);
    for (int i = 0; i < atts.getLength(); i++)
    System.out.println(" Attribute: " + atts.getLocalName(i));
    System.out.println(" Value: " + atts.getValue(i));
    public void endElement(String namespaceURI, String localName, String qName)
    System.out.println("End of element: " + localName);
    public void startPrefixMapping(String prefix, String uri)
    System.out.println("Prefix mapping: " + prefix);
    System.out.println("URI: " + uri);
    public void endPrefixMapping(String prefix)
    System.out.println("End of prefix mapping: " + prefix);
    public void ignorableWhitespace(char[] ch, int start, int length)
    System.out.println("Recieved whitespace.");
    public void processingInstruction(String target, String data)
    System.out.println("Recieved processing instruction:");
    System.out.println("Target: " + target);
    System.out.println("Data: " + data);
    public void setDocumentLocation(Locator locator)
    // Nada
    public void error(SAXParseException exception)
    System.out.println("Parsing error on line " + exception.getLineNumber());
    public void fatalError(SAXParseException exception)
    System.out.println("Fatal parsing error on line " + exception.getLineNumber());
    public void warning(SAXParseException exception)
    System.out.println("Warning on line " + exception.getLineNumber());

    Check to make sure that the arguments are consistent with your ContentHandler class. Probably the wrong type.
    I think you forgot to include the skippedEntity method, it seems to be missing. Even if an implemented class has a method that you are not using, you still have to include the method in your code even if it doesn't do anything.
    Message was edited by:
    ChargersTule1

  • ...is not abstract and does not override abstract method compare

    Why am I getting the above compile error when I am very clearly overriding abstract method compare (ditto abstract method compareTo)? Here is my code -- which was presented 1.5 code and I'm trying to retrofit to 1.4 -- followed by the complete compile time error. Thanks in advance for your help (even though I'm sure this is an easy question for you experts):
    import java.util.*;
       This program sorts a set of item by comparing
       their descriptions.
    public class TreeSetTest
       public static void main(String[] args)
          SortedSet parts = new TreeSet();
          parts.add(new Item("Toaster", 1234));
          parts.add(new Item("Widget", 4562));
          parts.add(new Item("Modem", 9912));
          System.out.println(parts);
          SortedSet sortByDescription = new TreeSet(new
             Comparator()
                public int compare(Item a, Item b)   // LINE CAUSING THE ERROR
                   String descrA = a.getDescription();
                   String descrB = b.getDescription();
                   return descrA.compareTo(descrB);
          sortByDescription.addAll(parts);
          System.out.println(sortByDescription);
       An item with a description and a part number.
    class Item implements Comparable     
          Constructs an item.
          @param aDescription the item's description
          @param aPartNumber the item's part number
       public Item(String aDescription, int aPartNumber)
          description = aDescription;
          partNumber = aPartNumber;
          Gets the description of this item.
          @return the description
       public String getDescription()
          return description;
       public String toString()
          return "[descripion=" + description
             + ", partNumber=" + partNumber + "]";
       public boolean equals(Object otherObject)
          if (this == otherObject) return true;
          if (otherObject == null) return false;
          if (getClass() != otherObject.getClass()) return false;
          Item other = (Item) otherObject;
          return description.equals(other.description)
             && partNumber == other.partNumber;
       public int hashCode()
          return 13 * description.hashCode() + 17 * partNumber;
       public int compareTo(Item other)   // OTHER LINE CAUSING THE ERROR
          return partNumber - other.partNumber;
       private String description;
       private int partNumber;
    }Compiler error:
    TreeSetTest.java:25: <anonymous TreeSetTest$1> is not abstract and does not over
    ride abstract method compare(java.lang.Object,java.lang.Object) in java.util.Com
    parator
                public int compare(Item a, Item b)
                           ^
    TreeSetTest.java:41: Item is not abstract and does not override abstract method
    compareTo(java.lang.Object) in java.lang.Comparable
    class Item implements Comparable
    ^
    2 errors

    According to the book I'm reading, if you merely take
    out the generic from the code, it should compile and
    run in v1.4 (assuming, of course, that the class
    exists in 1.4). I don't know what book you are reading but that's certainly incorrect or incomplete at least. I've manually retrofitted code to 1.4, and you'll be inserting casts as well as replacing type references with Object (or the erased type, to be more precise).
    These interfaces do exist in 1.4, and
    without the generics.Exactly. Which means compareTo takes an Object, and you should change your overriding method accordingly.
    But this raises a new question: how does my 1.4
    compiler know anything about generics? It doesn't and it can't. As the compiler is telling you, those interfaces expect Object. Think about it, you want to implement one interface which declares a method argument type of Object, in several classes, each with a different type. Obviously all of those are not valid overrides.

Maybe you are looking for

  • Multiple Source Messages Scenario - Need help

    Hi, This is my scenario. System A sends Message A System B sends message B both of them are diffrent strcutures. Now I need to map both of the messages to Message C and send it to system C. I would need help on how to achive this requirement. I tried

  • MP3 files not showing in iTunes on new iMac

    Hi - I have recently purchased my first Mac computer.  I have copied over all of my music but it seems that all the MP3 files are not playing.  It's strange they show in my folder list of itunes and it lets me play them, but in the main itunes folder

  • How to get HR Director and HR specialist in workflow?

    Hi, I need to send the work item to HR director for approval and then I need send work item to HR specialist for data entry in PA40. My problem is I dont know the way to identify the HR director and HR specialist.  Is the HR director the chief of the

  • Export itunes playlist on SD card

    Hi, I want to export a playlist from itunes on to an SD card. Is there a way to do this (other than drag&drop or Copy/Paste) so that I can keep the order in which the tracks are organised on my itunes playlist?

  • Caption to show in Gallery

    I'm having a heck of a time getting captions to show with photos in Galleries. I try Caption, I try Titles in metadata. I believe Keywords is more of an organizing too. Caption or title doesn't seem to get then into the gallery and viewable to my cli