Is there a default ContextMenu?

I notice that when I right click on a textarea, I get a menu of standard items. Is this a contextmenu? can I add to this using getContextmenu?
I ask because I assumed the answer to be yes but get a null ptr exception when I try to add a menu item. I don't want to lose the default menu items, just want to add an item.

Yes, there is a default context menu for TextInputControls (and a TextArea is a subclass of TextInputControl).
The default context menu is defined in the TextInputControlSkin.
http://hg.openjdk.java.net/openjfx/2.2/master/rt/file/tip/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextInputControlSkin.java
It is weird that you cannot get at the default context menu defined in the skin using the getContextMenu method on TextArea, but that doesn't work, nor does monitoring the contextMenuProperty of the TextArea for changes, as that property always remains null.
Short of defining a new Skin for TextArea in which you define your own ContextMenu, I don't know how you would modify the ContextMenu contents.
601     final MenuItem undoMI   = new ContextMenuItem("Undo");
602     final MenuItem redoMI   = new ContextMenuItem("Redo");
603     final MenuItem cutMI    = new ContextMenuItem("Cut");
604     final MenuItem copyMI   = new ContextMenuItem("Copy");
605     final MenuItem pasteMI  = new ContextMenuItem("Paste");
606     final MenuItem deleteMI = new ContextMenuItem("DeleteSelection");
607     final MenuItem selectWordMI = new ContextMenuItem("SelectWord");
608     final MenuItem selectAllMI = new ContextMenuItem("SelectAll");
609     final MenuItem separatorMI = new SeparatorMenuItem();
610
611     public void populateContextMenu(ContextMenu contextMenu) {
612         TextInputControl textInputControl = getSkinnable();
613         boolean editable = textInputControl.isEditable();
614         boolean hasText = (textInputControl.getLength() > 0);
615         boolean hasSelection = (textInputControl.getSelection().getLength() > 0);
616         boolean maskText = (maskText("A") != "A");
617         ObservableList<MenuItem> items = contextMenu.getItems();
618
619         if (isEmbedded()) {
620             items.clear();
621             if (!maskText && hasSelection) {
622                 if (editable) {
623                     items.add(cutMI);
624                 }
625                 items.add(copyMI);
626             }
627             if (editable && Clipboard.getSystemClipboard().hasString()) {
628                 items.add(pasteMI);
629             }
630             if (hasText) {
631                 if (!hasSelection) {
632                     items.add(selectWordMI);
633                 }
634                 items.add(selectAllMI);
635             }
636             selectWordMI.getProperties().put("refreshMenu", Boolean.TRUE);
637             selectAllMI.getProperties().put("refreshMenu", Boolean.TRUE);
638         } else {
639             if (editable) {
640                 items.setAll(undoMI, redoMI, cutMI, copyMI, pasteMI, deleteMI,
641                              separatorMI, selectAllMI);
642             } else {
643                 items.setAll(copyMI, separatorMI, selectAllMI);
644             }
645             undoMI.setDisable(!getBehavior().canUndo());
646             redoMI.setDisable(!getBehavior().canRedo());
647             cutMI.setDisable(maskText || !hasSelection);
648             copyMI.setDisable(maskText || !hasSelection);
649             pasteMI.setDisable(!Clipboard.getSystemClipboard().hasString());
650             deleteMI.setDisable(!hasSelection);
651         }
652     }

Similar Messages

  • Is there any default calendar which I can use on my form and report

    Hi All,
    Is there any default calendar which I can use on date field on my form and report.
    just by change its property like double click on date field and property calendar = yes
    or any other way.
    thanks
    mohan

    hi
    create a functions something like this.i hope it helps u.
    function call_calender ( f_dtm_set in date default sysdate ) return date is
    l_dtm  date;
    l_list paramlist := get_parameter_list ( 'CALL_CALENDER' );
    begin
    if
      not id_null ( l_list )
    then
      destroy_parameter_list ( l_list );
    end if;
    if
      trunc ( f_dtm_set ) != trunc ( sysdate ) --> if you call the calendar function with a date, the calendar will change to that date
    then
      l_list := create_parameter_list ( 'CALL_CALENDER' );
      add_parameter ( l_list, 'DTM_SET', text_parameter, to_char ( f_dtm_set, 'dd/mm/yyyy' ) );
    end if;
    copy ( null, 'global.calender_date' ); --> create a null global
    call_form ( 'form_name', no_hide, no_replace, no_query_only, l_list );
    if
      not id_null ( l_list )
    then
      destroy_parameter_list ( l_list );
    end if;
    if
      name_in ( 'global.calender_date' ) is not null  --> if the global is not null, give the choosen item back
    then
      l_dtm := to_date ( name_in ( 'global.calender_date' ), 'dd/mm/yyyy' );
    end if;
    erase ( 'global.calender_date' );
    return ( l_dtm );
    end;sarah

  • I'm installing a printer on a MacBook Air via USB connected DVD drive.  The computer asks for my password.  I don't hink we ever had one.  Is there a default password ("admin"

    I'm installing a printer on a MacBook Air using an external DVD drive via USB.  The computer is asking for my password to authorize changes to the system.  I don't htink I ever put one on the computer and "admin" and "password" don't work.  Is there a default password?  Or a way to change a password that has been forgotten, wothout resetting the computer and wiping everything out?  Thanks. 

    Many thanks.  As it happens, I wen to the local Apple Store today for an appointment with a "genius".  She helped me reset the password. And as I look at the screens on the page that you connected me to, they're the same as the genius used.  So your suggesstion was right on the money, and now I'm all set.  Thanks again.

  • Everytime I open my laptop, Lightroom tries to import photos from my hard drive. Does anyone know how to stop this?Is there a default I need to change?

    Everytime I open my laptop, Lightroom opens and tries to import photos from my external drive. Is there a default I need to change?
    Thanks in advance for any help.

    Error -36 is, as X423424X says, a generic I/O error. It doesn't say anything about what caused the error, or indeed where it occurred (source or target).
    You have to describe exactly your action when the error occurs. Is the ext'l drive you mentioned formatted as NTFS (Win default file system)? Without additional software, Mac OS X cannot write to NTFS, it can only read from it.

  • HT5509 In an app that was frozen, I triple-clicked the home button and activated "guided access". I never set a passcode but can't exit GA without one. Is there a default passcode when one is not set by user? ipad2 ios 6.something

    We have an iPad 2 running ios 6.something - I can't check that right now because we can't seem to exit "guided access".  I was playing Clumsy Ninja when it froze.  I didn't know about forcing closed or removing an app from the recent bar yet at the time, so I was looking through settings for some kind of intuitively obvious admin tool for shutting down a jammed app - to no avail.  Then I reopened the game and tried different things: holding the home button down, pressing the home button multiple times.  When I did that, "guided access" launched.  It informed me that it had deactivated the buttons, and asked me if I wanted to shut down parts of screen. No solution in that, so I attempted to exit GA at which point ipad requested a passcode - I never set a general passcode or a GA passcode, so I have no idea what to put in.  I have tried rebooting by means of Home and Power buttons - it reopens Clumsy Ninja with GA active. 
    Is there a default "Guided Access" passcode that would be in place since I haven't set one?

    Nope .  I was the only one using it and I did not set a passcode .  That would have been a red flag for me .  We don't have it configured to require a passcode for logon and I would not have created one intentionally . 
    Thanks for responding Diavonex . 

  • Hi when I try to connect some bluetooth devices I get asked for my pass code for the mac air .  I never had 1 is there a default code

    hi
    when I try to connect some bluetooth devices I get asked for my pass code for the mac air .
      I never had 1 is there a default code
    thanks
    rob

    the shaker wrote:
    is there a default code
    no.

  • Is there any default size for ArrayList

    The default capacity of Vector is 10.
    Is there any default size for ArrayList ??
    Vector v = new Vector();
    System.out.println("==> "+v.capacity()); // output is ==> 10
    java.util.List alist = new ArrayList();
    System.out.println("==> "+v.capacity()); // here the out put is ==> 0
    Regards
    Dhinesh

    No default size for arraylist.initially it's zero.
    I think u r comparing capacity with a size those two are different.
    Size- represents number of elements in the array.
    capacity- the capacity is the size of the array used to store the elements in the list. It is always at least as large as the list size. As elements are added to an ArrayList, its capacity grows automatically.
    it depends on the ensureCapacity() method in the arraylist.

  • AMS on EC2 - is there a default admin login?

    Is there a default admin login for ams_adminConsole.htm on a new instance? I just launched an instance of ami-766cce1f and am trying to find my way through the available control interfaces. It's way different than running a Wowza server!

    Hi,
    There is no default login for the admin server. Please refer to this doc to configure one:
    http://forums.adobe.com/docs/DOC-2334
    You can create a user date script and use it while creating an instance so that you don't have to do this manually again.
    Thanks,
    Shiven

  • Is there a default pass word for voice mail?

    cannot get to voice mail messages on my brand new iphone 5.  Have never intentionally set a password to protect it, but the phone insists i have one.  is there a default?

    http://www.apple.com/support/iphone/assistant/voicemail/

  • My iPod Classic is suddenly asking me to "Enter Code to Unlock".  Is there a default?

    I have been letting my 8 year old son use my old iPod.  It's the the old classic video iPod, 30GB, software version is 1.3 and says it's up to date.  Serial number is 4V544C1WTXK (I don't know if that matters or not).  He has been listening to music and playing games on it for months now without a problem.  And it has never asked for a code to unlock it.  I have never set one.  He may have by accident but does not know a code either.
    Is there a default code to unlock it?  If not is there a way to reset the code?  I can't use the iPod at all now.  I just replaced the battery in it so I really need to get it working.
    Any help from anyone would be greatly appreciated. Thank you in advance!

    Okay so I just did a factory restore.  It seems to be working fine now although I lost everything stored on it.

  • HT2477 I just purchased the IMac and was in the process of setting it up and got locked out.  A password is being requested and I did not establish one.  Is there a default password for the imac?

    I just purchased the iMac and was in the process of setting it up and it locked up, requiring me to put in a password.  I never established a password, does the iMac have a default password?

    If you have been using the mac.com Apple ID to make iTunes purchases recently, then there should be no issues continuing to use it with the new iPhone. I would abandon the new ID as you will never get Apple to merge the two IDs. I have had a mac.com ID for years and continue to use it with my iPhone 4S.
    Tell us the issues that you encounter trying to set up the iPhone with the mac.com account.

  • Is there a default maximum memory allocation ?

    Hi,
    I would like to ask if there is a default maximum memory allocation in the virtual machine?
    I know there are params for setting the initial und maximum size but I'm not sure if the vm will take as much memory as I have in my computer or not.
    thanks
    guenter

    Hi guenter
    Are you looking for the -Xmx parameter?
    According to the below link, the default maximum is 64MB
    http://java.sun.com/products/hotspot/2.0/README.html#Xmx
    tsopa

  • Is there a default focus Method ?

    I would like to have a button to be focused by default within a dialog such that user can easily fire the button's action. Is there a method to set default focus on a button ? Thanks !!!

    That's actually very helpful. I can now set a default focus button on a dialog. But then for some reason I can not set it for other dialogs initiated by this dialog. Since I have an opening dialog with a number of buttons, and those buttons will open up a new dialog. Right now I can only set the default focus to the opening dialog. The other dialogs that opens up from firing the buttons did not have the same effect as the opening dialog. Is there a way to fix it ? Thanks

  • Is there a default for text size

    Text size varies between 12pt and about 8pt - there does not seem tro be any logic that determines which. Size can be adjusted using CTL/+/- but you don't want to do this on every other page.

    Actually, text on the page is sized by the person who makes the page. generally, web designers do pick something between 8pt and 12pt, but they can pick really any size they want. If you want to change to the default size that the page was designed in, it's CTRL and 0 (Zero, not the letter 'o', this font is bad at sowing the difference).
    CTRL+/- is something that browsers have added to help people read text if the size the designer picked is difficult for them to read.

  • Is there a default administrator

    Hi can any one tell me if there is a default administrator somehow it seems I have only "standard" users.

    Hi
    This has been an occasional and random problem since 10.5 and usually affects the Client OS although I have seen it on the odd server.
    Reboot the server and hold down the alt key. Select the RecoveryHD partition. Once booted select Terminal from the Utilities Menu and key "resetpassword". The Reset Password Utility should now launch. Select the root (System Administrator) account and assign a password. Now reboot the server again.
    At the login window enter root's name which is root and the password you defined earlier. Access the Users & Groups Preferences Pane, select the local admin account and make it an administrator again.
    There are a number of other ways to do this depending on how you initially configured the server but assuming this was an "out-of-the-box" install the above may be the easiest for you?
    HTH?
    Tony

Maybe you are looking for