Is it OK to re-use 1 instance of editors and renderers?

Hi,
The simple version of the question, is can I make 1 instance of my custom cell editor and cell renderer classes and safely use it in all my JTable instances?
For example, I have a DateRenderer class, and instantiate it in a static member, and use it in all Date columns and tables, many of which will be instatiated at one time. If a column needs a non-default format, then I guess I'd create a special instance for it, other wise it would use the default instance.
It seems to be OK so far, but but my program hasn't received any serious usage yet.
As to why, I'm thinking this way, I've been messing around with CellEditors and renderers and despite wanting to use default functionality whenver possible, I find that I'm using custom versions for every situation... so if possible, I'd like to keep the number of instances to a minimum.
Regards
Iain

OK, I see what you mean.
Stop cell editing on focus lost isn't the default behaviour, but I've had to use it anyway (it seems to make sense).
The reason I asked is that, to get the behaviour that I want, it looks like I'll have to have my custom renderers and editors on every column of every table so I'd like to avoid unneccessary instantiation.
I'm aiming for a system where:
- 1 click selects the row (default behaviour),
- 2 clicks starts editing the cell (also default),
- but tabbing or pressing enter after editing a cell keeps you in editing mode.
I don't suppose that many people here have had experience with this, but entering Japanese (and presumably other non ascii type character sets) using MS's IME doesn't work very well with the standard JTable behaviour. If you don't double click, the entered japanese text appears in a little IME window somewhere on the screen (no neccessarily near the editing cell) and just gets lost when you press enter. You have to double click every time, and I can't see the users accepting that.
I'll be investigating this over tme, and hopefully will be able to get it working smoothly.
Thanks,
Iain

Similar Messages

  • Right steps to use DNG Profile Editor and ACR

    What is the right sequence of steps to do to use properly DNG PE and ACR ?
    Must be converted the RAW in DNG directly, without open the RAW in ACR ?
    Must be opened the RAW file in ACR, reset the ACR values to zero and then convert the RAW in DNG format ?
    Must be converted the RAW file in DNG and then reset the ACR values before apply the camera recipe created ?
    thanks in advance,
    federico

    thank you Massimo,
    the procedure is clear now.
    "What is the nearest original Adobe profile that is so "equal" to the GM one you obtain?"
    what i want to say is that when i open the file raw in ACR i see some colors. when i apply the profile generated by PE, i see about the sames colors. i notice that the colors are about the same without the profile (little differences i see in the darken tones but only in the ACR graphic). this with my D700. with the D200 the differences before to apply the profile and after are strong, visible.
    Grazie Massimo,
    credo sia tutto chiaro adesso anche se mi lascia perplesso il risultato finale.
    "What is the nearest original Adobe profile that is so "equal" to the GM one you obtain?"
    quello che volevo dire è che con o senza profilo, praticamente l'immagine con la D700 varia di pochissimo (me ne accorgo solo leggendo il grafico in ACR). con la D200 invece, applicare un profilo ha un impatto molto evidente, le differenze sono marcate.
    grazie
    ps: your english is right. it is mine that does not work so well.

  • Problem to use new abap editor and new abap debug.

    HI experts.
    currently using 640(patch 19) and GUI 640(patch 23).
    but when I activate new abap editor in se80 server dumps error
    ' Runtime Errors         MESSAGE_TYPE_X
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).'
    and new debug does not activating even though I switch to new debug.
    it works well both new editor and debug if I turn on new options when  I connect ECC6.0 with same GUI
    guess 640 server has not propery installed new editor and debug or something has to be checked.
    can anyone help me to activating these new functions?
    thank you.
    Lee

    There is a separate forum for the SAP GUI, please post your question over there and close this thread here.
    Thx

  • Can i use instance variables in page flow controller with out restriction?

    I am using instance variable in pageflow controller.
    1) Will it give any problem if concurrent users are accessing that controller class?
    2) How many controller objects will be created if multiple users (Say 10 users) accessing same controller class?
    Thanks.

    1) Will it give any problem if concurrent users are accessing that controller class? Pageflows are pere user session, different users wont cause it problems. however a single user can cause problems by using open new tab on a link etc(or back button or refresh on browser, problems with using state in a stateless protocol) . A bigger problem is that since a pageflow is indirect in session, using private variables in pageflow increases your session footprint and in a cluster , if replicated, your network trafiic as well. Using state also causes problem in HTTP , a stateless protocol,. Highly not recommended (unless you have no other choice)
    2) How many controller objects will be created if multiple users (Say 10 users) accessing same controller class? 10. assuming the portlet is used once only. If you use the same portlet in multiple pages , then you have that many.
    Edited by: deepshet on Feb 27, 2010 12:10 PM

  • Using instance variables

    Hi,
    I am currently evaluating this tool for a specific user group. I had a question in mind :
    In a typical workflow which involves database connections (i.e. inserting data in a database and displayign data) do you think we should pass data between various activities and users using instance variables or do you think we should retrieve data from the tables every time for display etc

    I would suggest get the data from the database first time and then store it in instance variables. Whenever, you need to update any values in the database from a particular activity, make a call to database to update it with the values from instance variables.
    For displaying, use instance variables. You do not need to get fresh data from database for each activity, unless you think that data in database keeps changing for that particular records every day.
    Regards
    Right Chord

  • [svn:fx-trunk] 7687: Forgot to have WindowedSystemManager use instance instead of static for mixins .

    Revision: 7687
    Author:   [email protected]
    Date:     2009-06-09 13:41:18 -0700 (Tue, 09 Jun 2009)
    Log Message:
    Forgot to have WindowedSystemManager use instance instead of static for mixins.  (regular SystemManager was changed to use instance instead of static before checkin)
    Also fix porting error in MarshallPlan.as
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-21461
    Reviewer: darrell
    tests: checkintests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21461
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/MarshallPlan.a s

    Hi Chris,
    I tried removing and adding back the dialpeer 101 and adding .T to 501 but still the same result. Please help.
    Please see the following:
    SEC-HO-VGATEWAY01#show dial-peer voice summ        
    dial-peer hunt 1
                 AD                                    PRE PASS                OUT
    TAG    TYPE  MIN  OPER PREFIX    DEST-PATTERN      FER THRU SESS-TARGET    STAT PORT    KEEPALIVE
    501    voip  up   up                                0  syst                    
    1001   voip  up   up             5...               1  syst ipv4:10.13.14.21   
    1002   voip  up   up             1...$              1  syst ipv4:10.13.14.21   
    103    voip  up   up             911$               1  syst dns:toronto2.voip.ms
    102    voip  up   up             1[2-9]..[2-9]...-  1  syst dns:toronto2.voip.ms
                                     ...$
    101    voip  up   up             [2-9]..[2-9]....-  1  syst dns:toronto2.voip.ms
                                     ..$
    SEC-HO-VGATEWAY01#show run | sec dial-peer voice 501
    dial-peer voice 501 voip
    incoming called-number .T
    voice-class sip bind control source-interface Loopback0
    voice-class sip bind media source-interface Loopback0
    dtmf-relay rtp-nte
    codec g711ulaw
    no vad

  • How to use iPhoto on Mac and iOS in conjunction

    I'm using iPhoto on both my Mac, iPhone and iPad. After the new Photo Stream and the new iPhoto iOS app has been released I think it is all started to get a little confusing. Here is some of my thoughts.
    1) When I delete a photo from my Photo Stream the photo gets deleted on all my devices. Nice. On my Mac, iPhoto is for instance creating a "mar. 2012 Photo Stream" event, where all photos from the Photo Stream is keept -- also the deleted once. That's OK. On my Mac I can cleanup these events by deleting the unwanted photos. All my photos are synced to iPad but it seems, that I cannot cleanup these events on iPhoto on my iPad. Is that right? I'm able to "hide" the photos from the events, but that does not delete them -- and they are still visible on my Mac after their are synced.
    2) I have an "Apple iPad Camera Connection Kit" making me able to import photos from my camera to my iPad, which I do daily when I'm on vacation. I thought that I could just import the photos to my iPad, put them in an event/album, edit/retouch them -- and when my iPad gets near my Mac the events/albums gets synced to my iPhoto on my Mac (without having to import them to the Mac manually). But it seems that the Camera app on my iPad is just putting the imported Photos in the "Last Import" album. How is Apple thinking we should do this? I cannot find a way to move them to an Event.
    3) Generally, the difference between Albums and Events in iPhoto iOS seems unclear. After the new iPhoto for iOS was released, I was hoping that I could edit, retouch and choose the best photos from an Events and put them in an Album. I can create a Journal with these photos but that is not always what I want. For instance if I would like to make a slideshow for my TV, it would be nice to have a clean album where only the best photos from an event. How is Apple thinking this should be done?
    Please tell me how you are using iPhoto on Mac and iOS. For me it does not work perfectly.

    Not only do they not work perfectly, they do not work together at all. Pretty much the only thing they share is a name. They are quite independent apps. Editing history on one can not be carried over to the other, so you can't start working on shots on one device and continue on the other. Events, Albums etc have no relation with each other and so on. Perhaps the next version of iPhoto (for either OS) will move them closer together but at this time they have no relationship at all.
    Regards
    TD

  • I am totally frustrated by the fact that now i have gone to iCloud and after a few synchs, my contacts are all mixed up with the wrong information.  For instance, my email and phone number comes up under someone else's name (a thousand contacts)

    I am totally frustrated by the fact that now i have gone to iCloud and after a few synchs, my contacts are all mixed up with the wrong information.  For instance, my email and phone number comes up under someone else's name (a thousand contacts).  I dont know how to repair this.  what a nightmare

    An icloud account is designed to be used by just one user.  If you have given your ID or set up your account on someone else's device, then their data will be mingled with your or worse.

  • Need Help on using Forge Config Manager and CAS. Questions listed in the content below

    Hi All,
    I have an existing Endeca pipeline implementation where we read the data sets (Product Catalog Information) from Oracle database using JDBC adapters. The data set undergoes a series of manipulation until it gets indexed to the Endeca system. We make use of PCI for dimensions and dimension values. However, we now want to extend PCI to also include the Product catalog information. The current implementation also does not make use of CAS adapters to consume the dimensions data in PCI. The next consideration is to implement PCI as close to Out of the Box provisions and standardize it. Therefore we are also considering to implement CAS.
    The questions are as below:
    1. What are the ideal parameters that should support the use of PCI implementation (Dataset + dimension + precedence Rules + schema information) ? Note: We DO NOT have any product catalog system (like ATG) between database and Endeca.
    2. Considering that we do not have any product catalog system to organize and maintain data, how feasible is it to read directly from database through CAS Adapters and process the data ?
    3. We also plan to introduce partial update pipeline in future releases. Keeping that in mind should CAS based approach help us to read from a record store at the time of partial updates ?
    4.in case we are limiting to a business case of implementing partial updates in the above explained existing design, should a custom CAS approach be a better design ? Custom CAS approach = writing the baseline output data to record store and later referring it at the time of partial updates.
    5. Will CAS based approach help to reduce the baseline timings ?
    6. What is the best way to export data to record store instance in the above design ? (Record store API / Command line utility / CAS crawl)
    Thanks,
    Nitin

    Hi Neeraj,
    You cam use both PI SLD and Solman Local SLD for LMDB synchronization. Now here you make to make sure that correct ranks are assigned to PI and Solman SLD. With the help of multiple sld, you can remove the cause of concern. Local SLD should always be of solman.
    For CR content. that you can do for solution manager system in a click.
    Divyanshu

  • Is Mac book pro useful for Video Editing and VFX Work?

    Hi Apple Team and Final Cut Pro Team,
        I am Video Editor and Motion Graphic Artist. I do a lot of Video Editing work and I have to spend hours sitting in front of my Desktop and this is getting so hectic for me. So I'm thinking of buying a Mac book Pro. But before spending that much bucks, I need to be sure that I'm going for the best option available. below is the configuration I am planning to buy. Kindly suggest me whether this is the best option or not. If not, then Please suggest me your options.
    Configuration:-
    Screen:- 15.4 Inch retina display
    Processor:-  2.5GHz quad-core Intel Core i7 processor (Turbo Boost up to 3.7GHz) with 6MB shared L3 cache
    Ram:- 16GB of 1600MHz DDR3L onboard memory
    Graphic Card:- NVIDIA GeForce GT 750M with 2GB of GDDR5 memory and automatic graphics switching

    I think a laptop is the best choice of all except when you need more power than you can get in a laptop. Even then "Both" is a great choice. In this instance, this laptop is more powerful than the largest Mac Mini that exists today, a great choice. You can't carry around an iMac or Mac Mini. The Macbook Pro Retina is the best thing out there. Again, except when your needs are greater than it can provide.
    Of course a good laptop can cost as much as a Mac Pro. They are fairly cost effective though when matched to a Mac Mini or iMac, although I did get my mini for under a thousand dollars with everything except monitors and external drive.. That Macbook Pro he's got is about $2,000..
    All a laptop is is a Mac Mini with it's own screen. So you get the best of both worlds, plus portability. Add monitors and mouse and keyboards and touchpad and external drives when you choose, or simply walk or drive away with your computer in your hand anywhere you go.  Try that with a Mini. A great advantage.
    Location stuff.. etc etc etc. Talk about chairs and whatnot, I like to lay in bed on my back with my laptop on my belly. Super relaxing. I too, get tired of sitting in that chair all the time. I don't care how good it is. I'm a truck driver. I know all about sitting for hours on end. It becomes torture.
    Both computers, that's the ticket.
    All of them if we're rich enough.
    $10,000 for a million dollars worth of equipment.
    The price of a good used car. Fantastic machines.
    On a side note, life without eating and drinking and ingesting stimulant drugs is a great life!
    Far and away more better than the stimulants ever could provide!!! Far, far superior. In all ways..

  • HT4060 My iPad wont charge at all. I'm using a wall charger and nothing shows up by the percentage.

    My iPad2 will not charge all of a sudden I don't know why. I'm using a wall charger and the battery symbol doesn't show up as being charged.

    Could be the cable, charger or iPad. Plug the cable into your computer, if it says not charging, the cable is good.
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    iPad: Charging the battery
    http://support.apple.com/kb/HT4060
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Dynamic class loading problem using unknown JAR archive and directory names

    I read the following article, which enlightened me a lot:
    Ted Neward: Understanding Class.forName().
    However, it took me some while to understand that my problem is the other way around:
    I know the name of the class, I know the name of the method,
    but my program/JVM does not know where to load the classes from.
    Shortly, my problem is that the server engine that I am writing
    uses two different versions of the same library.
    So I am trying out the following solution:
    My program is named TestClassPathMain.java
    Assume the two libraries are named JAR1.jar and JAR2.jar
    and the class/instance method that should
    be exposed to TestClassPathMain.java by them is named
    TestClass1.testMethod().
    As long as I was depending on just one library,
    I put JAR1.jar in the classpath before starting java,
    and I was happy for a while.
    At the moment I got the need to use another version of
    TestClass1.testMethod() packaged in JAR2.jar,
    a call would always access JAR1.jar's
    TestClass1.testMethod().
    I then decided to remove JAR1.jar from the classpath,
    and programmatically define two separate ClassLoaders, one for use
    with JAR1.jar and the other for use with JAR2.jar.
    However, the problem is only partly solved.
    Please refer to the enclosed code for details.
    (The code in the JAR1.jar/JAR2.jar is extremely simple,
    it just tells (by hardcoding) the name of the jar it is packaged in
    and instantiates another class packaged in the same jar using
    the "new" operator and calls a method on it. I don't enclose it.)
    The TestClassPathMain.java/UC1.java/UC2.java code suite was
    successfully compiled with an arbitrary of JAR1 or JAR2 in the classpath,
    however removed from the classpath at runtime.
    (I know that this could have been done (more elegantly...?) by producing an Interface,
    but I think the main problem principle is still untouched by this potential lack of elegancy(?))
    1) This problem should not be unknown to you experts out there,
    how is it generally and/or most elegantly solved?
    The "*** UC2: Variant 2" is the solution I would like best, had it only worked.
    2) And why arent "*** UC2: Variant 2" and
    "*** static UC2: Variant 2" working,
    while "*** Main: Variant 2" is?
    3) And a mal-apropos:
    Why can't I catch the NoClassDefFoundError?
    The output:
    *** Main: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** Main: Variant 2 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 2 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** UC1: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** UC1: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** static UC2: Variant 2 JAR 1 ***:
    Exception in thread "main" java.lang.NoClassDefFoundError: TestClass1
            at UC2.runFromJarVariant2_static(UC2.java:56)
            at TestClassPathMain.main(TestClassPathMain.java:52)
    TestClassPathMain.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class TestClassPathMain {
        public static void main(final String args[]) throws MalformedURLException, ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
                // Commented out because I cannot catch the NoClassDefFoundError.
                // Why?
                try {
                    final TestClass1 testClass1 = new TestClass1();
                    System.out.println(
                        "\nThe class TestClass1 is of some unexplicable reason available." +
                        "\nFor the purpose of the test, it shouldn't have been!" +
                        "\nExiting");
                    System.exit(1);
                } catch (NoClassDefFoundError e) {
                    System.out.println("\nPositively confirmed that the class TestClass1 is not available:\n" + e);
                    System.out.println("\n\nREADY FOR THE TEST: ...");
                // Works fine
                System.out.println("\n*** Main: Variant 1 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 1 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                System.out.println("\n*** Main: Variant 2 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 2 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                final UC1 uc1 = new UC1();
                System.out.println("\n*** UC1: Variant 1 JAR 1 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC1: Variant 1 JAR 2 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                System.out.println("\n*** static UC2: Variant 2 JAR 1 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** static UC2: Variant 2 JAR 2 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                final UC2 uc2 = new UC2();
                System.out.println("\n*** UC2: Variant 2 JAR 1 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC2: Variant 2 JAR 2 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
        private static void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
        private static void runFromJarVariant2(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    UC1.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC1 {
        public void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
    UC2.java
    import java.lang.reflect.InvocationTargetException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC2 {
        public void runFromJarVariant2(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
         * Identic to the "runFromJarVariant2" method,
         * except that it is static
        public static void runFromJarVariant2_static(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    }

    2. i need to load the class to the same JVM (i.e. to
    the same environment) of the current running
    aplication, so that when the loaded class is run, it
    would be able to invoke methods on it!!!
    ClassLoader(s) do this. Try the URLClassLoader.
    (I was talking about relatively esoteric "security"
    issues when I mentioned the stuff about Class objects
    "scope".) You might use the URLClassLoader kind of
    like this.
    Pseudo-code follows:
    // setup the class loader
    URL[] urls = new URL[1];
    urls[0] = new URL("/path/to/dynamic/classes");
    URLClassLoader ucl = new URLClassLoader(urls);
    // load a class & use make an object with the default constructor
    Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
    // Cast the object to a know interface so that you can use it.
    // This may be used to further determine which interface to cast
    // the class to. Or it may simply be the interface to which all
    // dynamic classes have to conform in your program.
    InterfaceImplementedByDynamicClass loadedObj =
        (InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
    this and you will see how it works.

  • Issue Migrating Character Data Using a Full Export and Import

    Hi There;
    I have a database in my local machine that doesn't support Turkish characters. My NLS_CHARACTERSET is WE8ISO8859P1, It must be changed to WE8ISO8859P9 , since it supports full Turkish characters. I would like to migrate character data using a full export and import and my strategy is as follows:
    1- create a full export to a location in network,
    2- create a new database in local machine that it's NLS_CHARACTERSET is WE8ISO8859P9 (I would like to change NLS_LANGUAGE and NLS_TERRITORY by the way)
    3- and implement full import to newly created database.
    I 've implemented first step, but I couldn't implement the second step. I 've created the second step by using toad editor by clicking Create -> New Database but I can not connect the new database. I must connect new database in order to perform full import. How can I do this?
    Thanks in advance.
    Technical Details
    NLS_LANGUAGE.....................AMERICAN
    NLS_TERRITORY.....................AMERICA
    NLS_CURRENCY.....................$
    NLS_ISO_CURRENCY..............AMERICA
    NLS_NUMERIC_CHARACTERS    .,
    NLS_CHARACTERSET.............WE8ISO8859P1
    NLS_CALENDAR.....................GREGORIAN
    NLS_DATE_FORMAT................DD-MON-RR
    NLS_DATE_LANGUAGE...........AMERICAN
    NLS_SORT...............................BINARY
    NLS_TIME_FORMAT.................HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT......DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT............HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT..DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY............ $
    NLS_COMP...............................BINARY
    NLS_LENGTH_SEMANTICS.......BYTE
    NLS_NCHAR_CONV_EXCP........FALSE
    NLS_NCHAR_CHARACTERSET...AL16UTF16
    NLS_RDBMS_VERSION............10.2.0.1.0

    First, if your applications run on Windows, do not use WE8ISO8859P9. Use TR8MSWIN1254.
    Second, if you create a new database, the database is not necessarily immediately accessible to outer world. I do not know Toad and I have no idea if it performs all necessary steps required for the new database to be visible.  For example, in the Toad itself, I assume you should create a new connection that references the new SID of the newly created database and use this new connection to connect. However, connections without a connection string use the ORACLE_SID setting in Registry to tell connecting applications which instance (database) to use.  To change the database accessed with an empty connection string you need to modify Registry (unless Toad has an option to do this for you). If you want to connect without changing Registry, you need a connect string. This requires setting up Oracle Listener to serve the new database (unless default configuration is used and the database registers itself with the default listener). It also requires changing tnsnames.ora file to create an alias for the new database. Net Manager and/or Net Configuration Assistant can help you with this.
    I wonder if Database Configuration Assistant would not be a better tool to create new Oracle databases.
    Thanks,
    Sergiusz

  • How to use same Data Type and Length for two fields

    How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
    SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
    FROM bsik
    INTO TABLE it_bsik
    WHERE bukrs = p_bukrs
    AND lifnr IN s_lifnr.
    IF it_bsik IS NOT INITIAL.
    SELECT belnr gjahr awkey awtyp
    FROM bkpf
    INTO TABLE it_bkpf
    FOR ALL ENTRIES IN it_bsik
    WHERE belnr = it_bsik-belnr
    AND gjahr = it_bsik-gjahr.
    IF it_bkpf IS NOT INITIAL.
    SELECT belnr gjahr lifnr xblnr
    FROM rbkp
    INTO TABLE it_rbkp
    FOR ALL ENTRIES IN it_bkpf
    WHERE belnr = it_bkpf-awkey+0(10)
    AND gjahr = it_bkpf-awkey+10(4).
    ENDIF.
    ENDIF.
    Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
    Kindly clarify.

    Hi Saurabh,
    Please see the example code that I have developed for you. It will help you solve the problem.
    REPORT ZTEST_3 .
    tables : BKPF.
    data : begin of it_bkpf occurs 1,
             belnr type RE_BELNR,
             awkey type awkey,
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf.
    data : begin of it_bkpf1 occurs 1,
             belnr type RE_BELNR,
             awkey type gjahr,              " change the data type
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf1.
    data : begin of it_rbkp occurs 1,
             belnr type BELNR_D,
             gjahr type gjahr,
             lifnr type LIFRE,
             xblnr type XBLNR,
           end of it_rbkp.
    select belnr
           awkey
           awtyp
           gjahr
           from bkpf
           into table it_bkpf
           where BUKRS = 'TELH'.
    loop at it_bkpf.
    it_bkpf1-belnr = it_bkpf-belnr.
    it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
    it_bkpf1-awtyp = it_bkpf-awtyp.
    it_bkpf1-gjahr = it_bkpf-gjahr.
    append it_bkpf1.
    clear it_bkpf1.
    endloop.
    select  belnr
            gjahr
            lifnr
            xblnr
            from RBKP
            into table it_rbkp
            for all entries in it_bkpf1
            where belnr = it_bkpf1-belnr
    This is just an example. Change the fields according to your requirement.
    Regards
    Abhii
    Edited by: Abhii on Mar 9, 2011 9:08 AM

  • How to specify and use arrays in .h and .m files?

    Ok, this is pretty basic. For regular variables, no problem.
    (in .h)
    @interface Mine : NSObject {
    int x;
    @property (assign) int x;
    @end
    (in .m)
    @implementation Mine
    @synthesize x;
    @end
    But, when I want to specify an array of objects, it fails, with "error: bad property declaration".
    (in .h)
    @interface Mine : NSObject {
    int x[15][10];
    @property (assign) int x[15][10];
    @end
    (in .m)
    @implementation Mine
    @synthesize x;
    @end
    If I don't use @property and @synthesize, I can use these arrays just fine in the .m file.
    However, the problem I run into, quite often is that I cannot use these without a warning, which usually causes an exception:
    x[myX][myY] = s;
    or
    [obj getX:myX :myY];
    gives a warning "assignment from a distinct Objective-C type" or "obj may not respond to -getX" which usually ends up with an exception:
    2009-08-17 16:56:00.512 AppName[9638:20b] * -[Mine getX::]: unrecognized selector sent to instance 0x103a800
    2009-08-17 16:56:00.538 AppName[9638:20b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[Mine getX::]: unrecognized selector sent to instance 0x103a800'
    2009-08-17 16:56:00.548 AppName[9638:20b] Stack: (
    807902715,
    2426465851,
    808284155,
    Can someone tell me how to do this properly?
    My app wants to create 2 arrays of 15x9 to manage a playing board on an x,y grid.
    I want one array to be of type NSString, and the other to be of class Piece (one of my own classes). In some places it works without the @property declaration using a custom getter and setter, but in other places the exact same code gives me one of the errors above.
    What am I missing?

    Still working this out. In my App, I really only use the "NSMutableArray* cells" to use as a representation of my initial layout, built from a string obtained in my scene plist file. (sceneTableau)
    An example board can be seen at http://reststop.homeip.net/dev/Picture4.png for those interested in seeing what the working code does.
    - (Board*) setupBoard:(Board*)b {
    if (b) {
    int loc=0;
    b.cells = [[NSMutableArray alloc] initWithCapacity:(boardWidth*boardHeight)];
    for (int n=0; n<boardHeight; n++) {
    for (int m=0; m<boardWidth; m++) {
    NSRange myRange=NSMakeRange(loc*3,2); // get first 2 of 3 chars
    NSString* t = [b.sceneTableau substringWithRange:myRange];
    [b.cells insertObject:t atIndex:loc];
    [t release];
    loc++; // increment to next piece
    } // for m
    } // for n
    }This works great, doing my own math for x,y. In fact this initialization loop ONLY used m,n for documentation and could simply be "for (int loc=0; loc<boardWidth*boardHeight; loc++)" to shorten the code. Since I don't ever actually modify the NSString*s I could make the setter routine for cells be an empty void method, e.g. "- (void) setCells:(NSString*) {}".
    I also noticed a couple of method in the NSString.h file:- (NSArray *)componentsSeparatedByString:(NSString *)separator;
    - (NSArray *)componentsSeparatedByCharactersInSet:(NSCharacterSet *)separator;which would allow me to simply use:b.cells = [b.sceneTableau componentsSeparatedByCharactersInSet:whitespaceAndNewlineCharacterSet];since my sceneTableau string is simply 135 sets of 2-character codes separated by a space or a newline.
    Taking this in the other direction, I could dispense with the cells array and simply use the sceneTableau field and my getter routine would be:- (NSString*) getCells:(int)loc {
    NSRange myRange=NSMakeRange(loc*3,2);
    return [b.sceneTableau substringWithRange:myRange];
    } (I may go ahead and make this change as it is a little more compact and I don't use this array except to initialize the display).
    However, for the pieces, I do need to keep an array, as there is more structure to the objects, and some objects will move from one position to another and the display will need to be redrawn after each move, changing the appearance of at least 2 positions and as many as 4 positions.
    If I did need to modify the contents of a cell, then I presume that I should really use objects of type NSMutableString* instead of NSString, and then the proper way to set a new value would be:
    - (void) setCells:(NSString* s) {
    NSMutableString* c = [self.cells objectAtIndex:(x+y*boardWidth)];
    [c setString:s];
    I am not sure what I need to do in the way of releasing c in this context. Does c go away at the end of the invocation, and no longer points to anything, or do I need to assign nil, or release c?
    I presume I could also do as my current code does[self.cells replaceObjectAtIndex:(myX+myY*boardWidth) withObject:s];but again I am not sure what I need to do about release. I gather that the NSArray handles retaining and releasing the objects which are put into or removed from its instance, and they will all be released when I release the NSArray in my dealloc method.
    Based on this, I do need to rethink my NSMutableArray* of pieces, as I will need to write methods that move the pieces and my earlier model does not allow them to move freely without having to perform some coding gymnastics in Objective-C. I will still need to use an array, NSMutableArray most likely.
    Have I missed anything?
    A quick question on my "setupBoard" routine above. You may have noticed that it takes a Board* and returns a Board*. I currently have to use[b setupBoard:b]; which seems wrong, but it works. What is the proper way to define and invoke this message so that my code would look more like this???[b setupBoard];
    and then to finish and do my releases
    [b upsetBoard];Is it correct Objectivc-C syntax to have a method that manipulates the contents of an object, such as my setupBoard method, and to say:invocation:
    [boardPointer setupBoard];
    implementation:
    - (void) setupBoard {
    if ( self ) { // test for non-nil
    [self.cells = [self.sceneTableau componentsSeparatedByCharactersInSet:whitespaceAndNewlineCharacterSet];

Maybe you are looking for

  • Baseline date calculation in Invoice verification (MIRO)

    Dear experts, I need to set baseline date after 40 days from document date in MIRO. Baseline date calculation of "Terms of Payment" in IMG has two parameters:   ・Fixed day   ・Additional months We cannot set 40 days in these parameters. Can anybody te

  • Mount: can't find /dev/sda2/mnt in /etc/fstab

    I'm trying to install Arch on a virtualbox virtual machine to become familiar with it before I install it on my main system. I've created 4 partitions, dev/sda1=1007kB boot partition, dev/sda2/= 4gb root partition which I am trying to mount, dev/sda3

  • Content Type Question

    I created a term set called 'Document Category' that has 10 different terms (e.g. Quote, Agreement, Diagram, etc.) that describe the types of documents users save into our main document library. I then created 10 different Content Types, each with it

  • Autorization for report RPUAUD00

    Hi all, is it possible to create authorization for report RPUAUD00 to work like this: if user start report it should display only changes which he makes. if hr manager start report it should display all changes for all users. Best regards.

  • ALV Doubt

    what d/w SLIS_FIELDCAT_ALV , SLIS_T_FIELDCAT_ALV regards,anji