Is there something like conditional compiling in JAVA...

...or do I really have to use a constant in the main class to prevent my test code from being executed in a final release. Which has the disadvantage, of course, that the code is still there.

You have to use the constant. The code will (should) not be in the compiled bytecode - the compiler will (should) optimize it out.

Similar Messages

  • Mac OS X: Is there something like com.apple.eawt to set dock icon?

    Hi,
    I want to set the dock icon of my application in Mac OS X.
    I have expected that it can just be set with the stage.getIcons().add("icon") because that's the way how it works in Windows 7.
    After I googled, I found that it can be done with a library: com.apple.eawt.
    There are also other thing like bouncing icon in the dock:
    http://stackoverflow.com/questions/15079783/how-to-make-my-app-icon-bounce-in-the-mac-dock
    I would have guessed, that stage.toFront() would make it bounce, because in Windows 7 that method makes the application blink in the task bar (it's quite similar).
    I'd like to see an API for things like that in JavaFX. Is there already a feature request?

    Well ok, and what about some other methods?
    I need to get the user's attention.
    For Windows 7 I can use toFront() method.
    For Mac I need this library, right?!
    I think a feature request for something like javafx.application.Application#requestUserAttention() would be fine, no?
    And I think stage.getIcons().add("icon") should also set the dock icon for Mac.

  • Linux - is there something like System Tray ?

    Hello,
    I coded few apps for Windows which where able to dock in system tray.
    Now I need something similar for Linux (using Mint dist. - with GNOME), and I am not sure, wheter Linux supports something like system tray.
    I know that linux isn't windows, but this would be very handy if it is supported ...
    fyi - there is code whic would work for windows
    final PutToTray ptt = new PutToTray(this);
    // this is my class which handles system tray
    // it uses current JFrame as parameter
            ActionListener blinkListener = new ActionListener() {
                public void actionPerformed (ActionEvent e) {
                    try {
                        ptt.switchIcons();
                       // this method switches picture icon with empty icon using some timing, so it looks like blinking (f.e. ICQ)
                    catch (InterruptedException ex) {
                        ex.printStackTrace();
            ptt.put();
            // this method puts app to tray
            blinkTimer = new Timer(10,blinkListener);
            ActionListener checkListener = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (sendAttackForm.isActive() == true) {
                        blinkTimer.start();
                        // tray icon starts blinking, when sendAttackForm appears
                        // not really important right now
            checkTimer = new Timer(10,checkListener);
            checkTimer.start();
            // some final code checking
            // not really important right now

    Falkenbach wrote:
    of course, its encapsulated in PutToTray classHaha, and how were we supposed to know that? You might think about providing an SSCCE .
    So, you have the code but want to know whether it will work on Linux? Do you not have a Linux machine available and just need somebody who does to test it out? If so, then the above-mentioned SSCCE would come in handy :)

  • Is there something like the fluxbox menu without fluxbox?

    I'm running Evilwm as my wm and very much like the minimalism, but lately I've been kind of missing the menu from Fluxbox.
    So I got to wondering if there was something similar out there; i.e. a program that opens a menu on some keycombo (say, control + right mouse. xbindkeys can sort out the details), displays a list of programs that can be launched, and upon either a selection by the user or some escape sequence removes the menu again. Any ideas?

    I dunno about a drop-down style menu like the one found in fluxbox, but I guess you could try out using dmenu after binding it to the key of your choice. It's probably not the best option, but it works nonetheless.

  • Javascript  - is there something like an "active row count" property??

    Lets say I have a tabular form. Every time I use the form, the # of rows returned by the query will vary. Maybe first time I go to the page, the select statement returns only 5 rows, but the next day it returns 25 rows.
    Is there some type of system variable to stores the # of rows visible on the page at a given time within this tabular form?
    I realize that if I have an tabular form item with an id of f03 for example, then on each row it will be referenced as f03_0001, then f03_0002 on the next row and then f03_0003 on the next row etc...
    In pseudocode, here is what I want to do:
    For i = 1 to ACTIVE_ROW_COUNT (assuming this is the # of rows in the HTML table)
    perform some operation on 'f03_000' + ACTIVE_ROW_COUNT
    Do you see what I'm after? I checked the APEX api, but I couldn't find such a property. It seems like you can't do much if you can't figure out this current index # or the max on the page.
    Also, I tried playing around with the "this" keyword in hopes of finding a pointer to the "current item" that would have triggered the onchange event, but no luck either.
    Thanks in advance.

    Hi:
    Within javascript you can reference the columns of the tabular form as
    <script>
    col1 = document.forms0.f01;  // the first updateable column of your report
    alert (col1.length) ;   //  number of rows
    </script>varad
    Edited by: varad acharya on Dec 8, 2008 5:53 PM

  • Is there something, like the SD card for example, that you can remove from your phone and leave somewhere so that when people are using Find My Friends, they think you're somewhere else?

    It's unavoidable - but I don't like being tracked. Is there a way to make everyone think I'm somewhere when I'm not?

    Delete the Find My Friends app. Don't give anyone your Apple ID password as if they had that, they could use Find My iPhone to track your phone. Don't let social media services (twitter, Facebook, Instagram) have access to your location services.
    If you are on an cell phone account that is controlled by someone else (e.g. parents) note that they may be able to avail themselves of carrier services to track your phone. In order to avoid being tracked that way, you would, as Bonanaza888 noted, you'ld need to put your phone in Airplane mode or turn it off.

  • Where can I find spell check is there something like word on the ipad?

    Are there references already on the ipad that I can use for editing? Should I be hooking up to the our main computer with word. I just got this ipad so I can write my blog.  I don't really know where everything is located is there a cheat sheet or something?

    Have a look at the following:
    http://itunes.apple.com/sg/app/quickoffice-pro-hd-edit-office/id376212724?mt=8&l s=1
    http://itunes.apple.com/sg/app/office2-hd/id364361728?mt=8&ls=1
    http://itunes.apple.com/sg/app/documents-to-go-premium-office/id317107309?mt=8&l s=1
    http://itunes.apple.com/sg/app/polaris-office/id513188658?mt=8&ls=1

  • Is there something like the questions widget in ibooks author in keynote?

    Does anyone know how if there is a review widget within Keynote as there is in iBooks Author that can show more than 6 questions and can I edit this so that multiple ticks can be shown and show more than 6 questions?
    I also want to know if I can alter the "Check Answer" button.

    The interactive system in Keynote uses hyperlinks, click a button and it will jump to another slide, that's the sum of the amount of interactivity available.
    An every day scenario; I want to review the scores to 5 questions with a multiple choice of 3 answers.
    This requires 5 slides one question per slide.
    I cannot click a button on slide 6, requesting to show the number of correct and wrong answers to all 5 questions. There is no database or dynamic library available to Keynote to allow a presentation of the data.

  • I have 30 gig Zen Xtra is there something like Yahoo/Napster/Rhapso

    Is there an unlimited monthly music plan service that will work with my player?

    Not until a new MTP firmware upgrade. Please search the FAQ for "firmware" for more details.

  • Is there something like Photoshop Channel Mixer in Adobe Illustrator?

    What is nice in Photoshop is being able to take fully illustrated art such as a red ball with shading and highlights, go into Channel Mixer, slide a couple of adjustment bars and it's changed to a blue ball or purple ball.
    Does Illustrator have a tool that does something similar to that? I'm having trouble figuring out the color editor and it seems require that I punch in different color percentages for each color it finds within the artwork that I have selected.
    I might as well click on each individual shape within the piece of art and change it's color that way.
    Any help would be greatly appreciated.

    Illustrator does not support channels. I do not presently have Phantasm loaded but it might be possible it has a channel mixer and Phantasm is a plug in for Illustrator. Check it out.

  • Conditional compiling in abap

    Is it possible, to use "compiler directives" in ABAP (as known in other programming languages), especially "conditional compiling".
    I would like this technique, for a conditional compiling in following situation:
    DDIC-TABLE M_VMVD ist available up to R/3-Release 4.6C
    Since Release 4.70 this table is replaced by SHP_VIEW_EXVE.
    If possible, i want to write <u>one</u> coding for both releases.
    It is not sufficient to use a "normal" if - command, because syntax-check will detect an error (table xy is not known).
    Here a - fictional - example, what i think about:
    *# IF_COMPILER_RELEASE <  470.  (fictional Compiler-Directive)
    select single vbeln into my_vbeln from m_vmvmd where lifex = my_lifex.
    *# ELSE_COMPILER_DIRECTIVE (fictional)
    select single vbeln into my_vbeln from shp_view_exve where lifex = my_lifex.
    *# ENDIF_COMPILER_DIRECTIVE  (fictional)
    I know, that there was a conditional-compiling-technique for differing R/2 and R/3.
    It was something like that:
    *#R2    write: / 'Compiled with R/2'.
    *#R3   write: / 'Compiled with R/3'.
    Best Regards
    Juergen

    Hi jurgen,
    1. compiler directives are not supported in abap r/3,
      in the way, they are used in c and c++.
    2. However,
    3. For your requirement, we can use
        select with dynamic table name,
       and an if condition.
    4. To get a taste of it, just copy paste.
    5.
    REPORT abc.
    data : bukrs like t001-bukrs.
    data : tabname(30) type c.
    tabname = 'T001'.
    CONDITIONAL , NORMAL IF
    IF REL < 470.
    tabname = 'XYZT001'.
    ENDIF.
    select single bukrs
    from (tabname)
    into bukrs.
    WRITE :/ BUKRS.
    regards,
    amit m.

  • Is there smth like binding layer in another frameworks?

    Hello,
    Probably not kind of a question to post here.
    Is there something like binding layers in another Java web frameworks?
    A feature to bind data to an iterator keeping row currency and master/detail management?
    Thanks.

    I'm not sure there is something like this in the Java world.
    There is CDI in Java EE 6 that aims at simplifying the connection of Business Services to JSF UI - but I don't think it takes care of things like row currency.
    I think that .Net has some solution for binding too - but then again that's not Java.

  • Exist a Jtree node.id or something like this ?

    I would want to retrieve a node using a unique 'id', for example the absolute index (into the total nodes count)
    Is there something like this ?
    Can I add a particular property to a node ? ( for example this 'id' if it does not exist )
    Another question :
    If I want to implement a search code, this 'id' can be useful, or must I transverse the whole Jtree
    Thanks

    Hello.
    Do the following:
    1. Go to the Apple Menu at the top left of the screen
    2. Select Software Update...
    3. Install any updates that are found.
    If the Amazon issue continues after these updates, then do this:
    1. Open Safari
    2. Erase any web address you have currently showing (for example www.apple.com or www.google.com)
    3. Type in www.amazon.com
    4. That should take you directly to amazon.com
    It should look like this in your Safari::

  • E71: Is there somthing like ipconfig/command promp...

    Is there something like a command prompt on the E71 where I can run something similar to ipconfig?  When I goto the address of 192.168.1.1, I normally get the local wifi routers prompting for passwords...... but now theres a new access point appearing and I want to find out what the IP is I'm connecting on without dragging the laptop around.
    Which led me to notice I had no clue about any form of command prompt on the phones OS, searching the internet given me developer level info that really is too much.

    EXCELLENT! Could you please please post your dialling files for AT&T?? Even better if you could upload a zip of your entire /etc/ppp/peers folder that would be nicer even. I am in desperate need to get the $15 MediaNet tethering on my Fedora 10 laptop working over bluetooth, I used to do it before with T-mobile T-zones with my E61, but since then I switched to my E71 and moved my number to AT&T and my attempts to adapt my scripts to AT&T have not been successful yet however tethering under Windows XP with the Nokia PC suite works though...

  • How do yah make something like this?

    I'm trying to make simething like this. However I'm stuck on what sort of algorithm would be used. Any idea? Thanks a bunch in advance for any help!
    http://i91.photobucket.com/albums/k293/rawlehypermode/Untitled.jpg

    You meant something like this ?
    import java.awt.Dimension;
    import java.awt.Graphics;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class LineDemo extends JPanel {
        final static int SIZE = 640;
        final static int STEP = 20;
        protected void paintComponent(Graphics g) {
            for (int i = 0; i < SIZE; i += STEP) {
                g.drawLine(i,0,SIZE,i);
                g.drawLine(SIZE,i,SIZE-i,SIZE);
                g.drawLine(SIZE-i,SIZE, 0, SIZE - i);
                g.drawLine(0, SIZE - i,i,0);
        public static void main(String[] args) {
            JFrame frame = new JFrame("Line demo");
            frame.add(new LineDemo());
            frame.setPreferredSize(new Dimension(SIZE+STEP,SIZE+2*STEP));
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
    }

Maybe you are looking for

  • Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?

    Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?

  • Scheduling agreement_track the quantity

    Hi Experts, The requirement of the customer is entered in a Scheduling agreement. Sometimes the schedules are changed in the quantity only. The customer needs a report that should show the quantity entered earlier and changed later. The scheduling ag

  • Assign business system

    I have created a business system in SLD.  When I want to assign this business system to the scenario, I can not find it in the wizard and also not show on Object tab. It is a new business system, I dont assign it to the other scenarios. How to find i

  • New Message Saved Multiple Times In Drafts Folder

    I know that while I'm composing an email the program automatically saves a copy of that message to the drafts folder. This copy is updated while I'm composing the message. But recently, as I'm composing a message, the same composition is saved multip

  • How can you keep the file name when using "Download Linked File As..."?

    I'm a longtime PC user finally making the transition to Mac.  Some of the tasks that seemed so simple in Windows have really stumped me!  One of the tasks I do frequently is download files into specific folders.  After much looking, I finally found t