Disabled components: to popup or not to popup context menu?

Hi experts,
just noticed that Swing pops up a component menu on mouse click even if the component isn't enabled. Seems to contradict the general rule to not allow "active" interaction (vs. "passive" as f.i. still showing the tooltip, the distinction is probably freely invented but serves me well enough ;) with a disabled component.
Could half-way live with that - except that then all menu items need to be disabled individually. Another option would be to return a null componentPopup if disabled. Not generally applicable because requires subclassing. Yet another might be to force-inject a MouseListener into the rootPane: it would intercept and swallow the popup triggers if the target is disabled, otherwise delegate to the ui-installed listener.
Comments please?
Thanks
Jeanette

>
release is out (here's a screenshot: http://www.jyloo.com/news/?pubId=1297423104000 - commercial, though) - so have a bit more time right now to tackle this
What puzzled me most in your comments was:
>
(and set the show popup action enabled/disabled as well). because I expected that to be not a problem at all: RootPane's action in isEnabled(sender) first checks if the sender is the focusOwner and returns false if not. Disabled components cannot be focusOwner, so safe territory. Except ... they can, even if there are enabled focusable components around. Turns out that the KeyboardFocusManager isn't clever enough to keep transfering the focus when a whole bunch of components is disabled. Or maybe it's a timing issue, as focus transfers can be asynchronous, and/or are tricky anyway, don't know. Whatever, when disabling a bunch of components, it must be done in the inverse order of the focusTransferCycle ... and that's completely unmanageable except for most simple contexts, like focus cycle is the same as insertion order, than reversing disable loop is a brittle option
// before calling this, focus on parent.getComponent(0)
// the natural way of disabling the children
for (Component child: parent.getComponents()) {
     child.setEnabled(false);
// after the call, focus on parent.getComponent(1)
// inversing
for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
   parent.getComponent(i).setEnabled(false);
// focus somewhere elseINCREDIBLE ...
overriding getComponentPopup to return null if disabled (as I did as a quick measure) is not really an option - don't want to override each and every component ;-) Another hook - not clean either, but at least manageable, might be a custom JPopupMenu: subclass and show only if enabled.
@override
public void show(Component invoker, int x, int y) {
    if (!invoker.isEnabled()) return;
    super.show(..)
}This still leaves the action enabled fooled - reports true because the invoker has a componentPopup - but then, a disable comp should be focusOwner anyway.
Cheers
Jeanette

Similar Messages

  • My right click is not working. the context menu does not come up and i can no longer drag files/folders. I have checked the mouse and track pad in system preferences and the correct boxes are all checked (with a support member). Please can you help

    My right click is not working and producing the context menu or ability to drag files and folders. I just spoke with a phone support person and we checked that all the mouse/trackpad options for right click were correct and checked.
    Please can you help with this.
    It has only just happened in the last few days.
    Many thanks

    You might want to update your profile so that we can see what model iMac you have and what version of OSX you're running.
    For this question, it might help to know if you're dealing with a trackpad, Magic Mouse, or something else?
    (Until your issue's resolved, you can Control-Left Click to get the right click functionality).

  • Safari 5.0 - Disable local file restrictions Option not found under Develop Menu

    Hi All,
    My system specs are as follows :
    Platform : Linux
    OS : lubuntu
    OS Version : 13.10 Saucy Salamander
    Browser : Safari 5.0
    I need to open a html file in Safari before which I need to enable this option - "Disable local file restrictions" under Develop menu as available in Safari 7.0 for OS X Marvericks.
    Problem here is I am not able to find this option in Safari 5.0, also I am not able to find any way to upgrade Safari in Linux.
    Please suggest how can I activate this.

    Safari->Preferences->Advance->on the bottom. To get the Debug menu which includes a listing of Keyboard & Mouse Shortcuts, among other useful things, run this in the Terminal app and quit & relaunch Safari:
    *defaults write com.apple.Safari IncludeInternalDebugMenu 1*

  • Creating Popup Context Menu's

    I am trying to make a pop menu ("conext menu"?) when the user right clicks on a selected path object. I have looked through the docs and found that the basic suite claims to be able to do this. Using the create function, I see that it doesn't do anything noticable. I have tried passing the ADMListRef object that buffers the reference to the menu to the List Suite, but I can't seem to get it to do anything.
    How do you make/add to menu's that the user gets when they right click?
    Am I on the right track?
    Is there any better documentation on these suites that I can look to for answers?
    Thanks in advance,
    Jeremy

    Ok, I've got the menu but for some reason notfications are being sent back to the Item, not the entry/list's. This is what I have so far
    In the dialog i create the Item:
    g->cMenu = sADMDialog->CreateItem(reference,kADMUniqueItemID,kADMPopupMenuType,&button,ChanMenuInit, NULL,0);
    The item is a button with an arrow that points to the right. when clicked it pops a menu out to the right that has two columns.
    The Item's init function is this:
    static 
    ADMErr ADMAPI ChanMenuInit(ADMItemRef inItem){g->list = sADMItem->GetList(inItem);
    for(int i = 0; i < g->numChannels; i ++){g->MenuItems[i] = sADMEntry->Create(g->list);
    sADMList->SetNotifyProc(g->list,MenuChannelCatch);
    sADMEntry->SetText(g->MenuItems[1],
    "1");sADMEntry->SetText(g->MenuItems[2],
    "2");sADMEntry->SetText(g->MenuItems[3],
    "3");sADMEntry->SetText(g->MenuItems[4],
    "4");sADMEntry->SetText(g->MenuItems[5],
    "5");
    return kNoErr;
    This shoudl create 5 Entries into the list (which it does); however, each entry is blank with no value. When clicked a notifier for the button is triggered, not the list (I put the button notifier after noticing that that the list wasn't doing anything). I'm probibly missing some kind of Init procedure, any ideas?

  • Content Presentor is not apperaing in Context Menu

    During trying out webcenter tutorial provided in below link, I did not find the *"Content Presentor"* menu item while drag and drop of home.html to panelCustomizable tag of home.jspx.
    The following mentu item were found.
    ADF Go Link
    Document - Documents Viewer
    Document - Mini Viewer
    ADF Inline Frame
    Document - Upload
    Document - Rich Text Editor
    The following menu items are not found
    Document - Version History
    Document - Properties
    Document - Content Presentor
    Blogs
    Tutorial Link - http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e10273/createconnect.htm#CBBEAFBB
    JDeveloper Version - Studio Edition Version 11.1.1.5.0
    But I am able to see "Content Presentor" under Component Palette / Document Service / Regions_
    Any pointer how can I proceed for the tutorial?
    Thanks In Advance!
    priyadarshi
    Edited by: priya4priya on May 30, 2011 9:33 PM

    What does the tutorial says? Does it require a content server or does it says to use a file based connection?
    I'm not sure but i think that could be the problem. The content presenter is designed to work with UCM, not a file based connection.

  • Disable Context Menu - Flash Professional Export (Flash 11.2 - CS6)

    Flash 11.2 added the capability to attach an right-click mouse-event to MovieClips.
    EX:
    var mc:MovieClip = new MovieClip
    mc.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, myFunction);
    When this listener is attached, it should be impossible for the Context Menu to pop up on right-click of this object. Flash disables the functionality.
    When I export a new SWF from Flash Professional (CS6 Mac) and that SWF is embedded in the browser, it works as expected. Right-click does not spawn a context menu.
    However, this is not the case with the flash player within Flash Professional. The flash player presented within Flash Professional just after export will does not hide the context menu.
    While it's possible for me to develop by simply exporting the SWF and testing it in-browser, I lose out on all the debugging that Flash Professional offers.
    How do I fix this issue?
    NOTE:
    This issue isn't with exporting to 11.2 - I can already do that. All changes mentioned in this tutorial have already been made with base install of Flash Professional CS6.
    running:
    trace(flash.system.Capabilities.version)
    results in:
    MAC 11,2,202,228

    I've got the same problem!
    I'm currently using Adobe Flash CS6 and I don't gave an idea of how to deploy my apps to be published on the Mac App Store!
    If you find the answer, please, let me know!
    Here's my email: [email protected]
    Thanks a lot!

  • Place command not appearing in file menu

    I click file and do not see the Place Command so I can insert picture. Where else could it be?

    Hold on a sec. Are you saying it appears in the File menu, but not in the context menu?
    That's normal -- I've been asking for years for Place to appear in context menus...
    Here's a script written a few years ago by Gerald Singelmann that will add the command to the context menu:
    //Add "Place" to the context menu by  Gerald Singelmann
    //Place this script into the "Startup Scripts" Folder inside the scripts folder in the app folder.
    #targetengine "session"
    ContextPlace();
    function ContextPlace(){
    var myResult = true;
    if(myResult == true){
    var myLayoutContextMenu = app.menus.item("$ID/RtMouseLayout");
    var myBeforeDisplayListener = myLayoutContextMenu.addEventListener("beforeDisplay", myBeforeDisplayHandler, false);
    function myBeforeDisplayHandler(myEvent){
    if(app.documents.length != 0){
    if(app.selection.length == 1){
    switch(app.selection[0].constructor.name){
    case "Rectangle":
    case "Oval":
    case "Polygon":
    case "GraphicLine":
    case "TextFrame":
    //Add the menu item if it does not already exist.
    if(myCheckForMenuItem(myLayoutContextMenu, "Place...") == false){
    myMakeMenuItem();
    break;
    default:
    if(myCheckForMenuItem(myLayoutContextMenu, "Place...") == true){
    myLayoutContextMenu.menuItems.item("Place...").remove();
    function myCheckForMenuItem(myMenu, myString){
    var myResult = false;
    try{
    var myMenuItem = myMenu.menuItems.item(myString);
    myMenuItem.name;
    myResult = true
    catch(myError){}
    //alert("Menu item found? " + myResult);
    return myResult;
    function myCheckForScriptMenuItem(myString){
    var myResult = false;
    try{
    var myScriptMenuAction = app.scriptMenuActions.item(myString);
    myScriptMenuAction.name;
    myResult = true
    catch(myError){}
    //alert("Script menu action found? " + myResult);
    return myResult;
    function myMakeMenuItem(){
    if(myCheckForScriptMenuItem("Place...") == false){
    //alert("Making a new script menu action!");
    var myMenuAction = app.scriptMenuActions.add("Place...");
    var myEventListener = myMenuAction.eventListeners.add("onInvoke", myEventHandler, false);
    var myPlaceMenuItem = app.menus.item("$ID/RtMouseLayout").menuItems.add(app.scriptMenuActions.item("Place..."));
    function myEventHandler(myEvent){
    //alert("Got to myEventHandler!");
    if(app.selection.length == 1){
    switch(app.selection[0].constructor.name){
    case "TextFrame":
    case "GraphicLine":
    case "Rectangle":
    case "Oval":
    case "Polygon":
    var myFile = File.openDialog ("Place file...", undefined, false);
    app.selection[0].place(myFile);
    break;
    } else {
    alert("Please select only one frame.");
    Copy the code above and paste into a plain text editor like Notepad. Save as type "all files" and add the .jsx extension. It should be placed into the application \Scripts\Startup Sripts subfolder and it will run when ID starts up. The folder should exist in CS5, but if not you can add it.
    Here's one by Dirk (I think Becker) that does the same thing to add No Break:
    #target "InDesign"
    /* This script will copy the existing menu action into a new menu item.
    The "$ID/" strings ensure it will even work with localized versions of InDesign.
    For permanent execution, save the script as startup script e.g. in a folder "path to InDesign/Scripts/new folder/startup scripts".
    Dirk
    ( function () {
    var anb = app.menus.itemByName("$ID/CharPanelPopup").menuItems.itemByName("$ID/Apply no break");
    var atc = app.menus.itemByName("$ID/RtMouseText");
    try {
    atc.menuItems.itemByName(anb.name).remove();
    } catch( ex ) {};
    atc.menuItems.add(anb.associatedMenuAction,LocationOptions.BEFORE,atc.menuItems .itemByName("$ID/ClearAllOverrides"));
    Do the same for it.

  • View Source not showing up in context menu?

    Yes I did choose to allow view source during the release
    build. I also uploaded the source folder to the server. I can
    manually go to the view source folder and it is working fine, only
    thing is, the option is not in the context menu of the application.
    I suppose I can add it there myself but I thought that was
    automatic?
    Thanks!

    quote:
    Originally posted by:
    levancho
    if you are using FB3 you can you feature called : "Export
    Project" and it does everything for you, including view Source
    Feature,
    just select your project and then click on Project -->
    Export Project
    and in dialog select "View Source" and then finish.
    That is exactly what I did, I go to Export Release Build, I
    select View Source, I choose which files to show, I name what
    directory I want it to be in. I click Finish, Then I upload
    everything from the release-bin to my server. I can manually go to
    the view source URL and that works, but the option does not appear
    when I right click the .swf. But as a work around I can add the
    option to the context menu myself and use navigateToURL to send the
    user there.

  • A context menu does not appear when I type the annotations

    I want to change the size and color of the pen, but can not get the context menu.

    Hi,
    Could you please try following steps and let me know if this helps.
    1) Open you pdf.
    2) Tap on pdf to bring the top bar.
    3) Tap on Comment icon.
    4) Choose pen.
    5) Draw the annotation with your pen
    6) Press Save
    7) Tap on your annotation.
    Here you will get the context menu that will allow you to change Thickness,color and opacity of your annotation.
    -mayank

  • How do I disable the brushes popup menu when I left click in Photoshop CS5?

    How do I disable the brushes popup menu when I left click in Photoshop CS5? I am trying to use the clone stamp and I am not able to get a sample because of this popup menu.

    LOL,  I can't even begin to complain with the number if times I misread questions, and then try to break my own record for the number of typos in a single post.
    The image above was taken on a photgraphic weekend where the group (of all young ladies ) I was travelling with, set us a photography challenge.  The one above was my response to a 'faceless portrait'.  The only other one I attempted was this response for a picture of a 'wild animal', featuring camera club president Liz.
    Oh what fun we had, laughing and laughing until our faces fell off.
    [EDIT]  Both taken at Karamea, which some visitors to NZ might recognise as the western end of the Heaphy Track.

  • Disable BAPI Error Popup Message

    Does anyone know how to disable to the popup message that occurs in VC when a BAPI return an error message (message of type E)?  We want to display a default error message to our users, instead of the cryptic ABAP error messages.
    Maximum point awarded to the first correct answer.

    Method 1:
    1. Drag datastore to your storyboard
    2. Right Click datastore and select Configure Element
    3. Click + button to Add new field
    4. Enter Fieldname=SHOWPOPUP, Type=Boolean, Default=false
    5. Click on dataservice that is feeding your message input and drag into the datastore
    6. Right Click on this new data mapping line and select Confgure Element
    7. Click on fx for the SHOWPOPUP field and set the value to TRUE.
    8. Right Click your popup Form and select Configure Element
    9. Click + button to Add new field
    10. Select PUSHBUTTON control and enter field name OK
    11. Double Click the OK fiend to open configuration popup
    12. Select ACTION tab and change radio button to CUSTOM ACTION and enter name HIDEPOPUP
    13. Click on fx on the VISIBILITY CONDITION of the form and select enter formula
    14. enter STORE@SHOWPOPUP as the formula
    15. Click on the OUT port of the popup form and drag line into the datastore
    16. Right Click on this new data mapping line and select Configure Element
    17. Click on fx for the SHOWPOPUP field and set the value to FALSE
    18. Select the dropdown list for the EVENT NAME at the top of the Data Mapping and select HIDEPOPUP as the event.
    19. Select LAYOUT tab and readjust the position of the form over the top of your output table.
    NOTE: you may need to click the BRING TO FRONT icon in lower left with your popup form selected to insure that it is not hidden behind other objects.
    Method 2 :
    There is another option in System action (PROMPT) where u can pass the message that will prompt sucesss or failure message but you have to trigger it by using pushbutton.
    Both the method worked for me sure it will work for u also .
    Regards
    Abdull Hakkim .K

  • How to disable cs5servicemanager update popup at startup?

    how to disable cs5servicemanager update popup at startup?

    I am getting the same thing since I updated to Yosemite last week
    At EVERY restart and boot I get the message, "To Open 'CS5ServiceManager' you need to install the legacy Java SE 6 runtime.
    My System running 10.10:
                  Model Name: MacBook Pro
                  Model Identifier: MacBookPro10,1
                  Processor Name: Intel Core i7
                  Processor Speed: 2.6 GHz
                  Number of Processors: 1
                  Total Number of Cores: 4
                  L2 Cache (per Core): 256 KB
                L3 Cache: 6 MB
                Memory: 16 GB
                  Boot ROM Version: MBP101.00EE.B05
                  SMC Version (system): 2.3f36
                  Serial Number (system): C02J57H7DKQ5
                Hardware UUID: 8678CB48-DA7A-537F-A2B2-B3A53F98456B
    All Adobe software is up-to-date with CC2014
    All Adobe CC software has been uninstalled except a couple like Bridge, Lightroom 5, Adobe Acrobat Pro XI
    Any Ideas what is going on?

  • Swing disabled components look and feel problem.

    Hi All,
    I have a Swing application. My system is recently upgraded to JRE 1.6 and I'm facing problem with look and feel of swing components when they are disabled. Color of disabled components is very faint and its being difficult to read the text in such disabled components. In JRE 1.4 this problem was not there. Please let me know what I can do to get the look and feel(Color and Font) of disabled components, same as JRE 1.4.
    Thanks

    Sandip_Jarad wrote:
    ..I have a Swing application. My system is recently upgraded to JRE 1.6 and I'm facing problem with look and feel of swing components when they are disabled. Which look and feel is the application using? As an aside, did it never occur to you to mention the PLAF?
    ..Color of disabled components is very faint and its being difficult to read the text in such disabled components. Why is it so gosh-darned important to read the text on a control that is (supposedly) not relevant or not available?
    ..In JRE 1.4 this problem was not there. Please let me know what I can do to get the look and feel(Color and Font) of disabled components, same as JRE 1.4. Here are some suggestions, some of them are actually serious. I'll leave it as an exercise for you, to figure out which ones.
    - Run the app. in 1.4.
    - Use a custom PLAF that offers a 'less faint' rendering of disabled components.
    - Use Motif PLAF (I haven't checked, but I bet that has not changed since 1.4).
    - Put the important text in a tool-tip.

  • What happened to the "Block Popup Windows" menu item in Safari 6?

    What happened to the "Block Popup Windows" menu item in Safari 6?  Seems to be gone.

    Shheesh!  Loki is saying that this was a very useful tool/option.  Is there any way to BRING IT BACK TO THE SAFARI MENU?  Not how to do it in Preferences.
    What I am saying is: What incompetent is responsible for this build of Safari?  There was no reason to take that out... plenty of room in the Safari menu.  But if you REALLY want to know why I'm ******, Older people can no longer go into "Appearances" and change the Fonts and Size without knowing how to use terminal or how to make .css files.  (which doesn't work well anyway)
    This build is infuriating.

  • Updater fails 9.1.1 to 9.1.2 - msg "re-enable disabled components"

    Adobe reader 9.1.1 won't update itself via updates, nor will the stand alone updater work.
    The "re-enable disabled components" message referred to with other products pops up.
    I've deleted the app.  Deleted all pref and lib/app support files.  Reinstalled, and hit the same wall.
    The computer is PPC running 10.5.7.
    The HD is formatted w/ a case-sensitive journaled HFS.

    Michael:
    Thanks for your speedy reply.
    Adobe Reader has worked atop case sensitive file systems for me for some time.  I began using them in 10.4 Tiger, though they were introduced as an option going back to 10.3 Panther, which was released to the public 10/2003, and developers like Adobe  before that.
    If the file system is not supported then it should be clearly, and prominently noted on the download page, and perhaps a warning in the installer (if the installer can't itself test for the presence/type of file system and put up some dialog box warning of pending difficulties).
    While I don't use/have no need for the CS, I'm aware of the issues Adobe had w/ the CS suite and case sensitivity (it was just reported in the mac news) but I don't ever recollect seeing that Reader was affected.  Certainly finding out that this is the case by doing google searching, troubleshooting, and help forums takes a distant rear seat to getting warned up front.
    Just to make sure, I went to the download page (no warning), went to system requirements (no warning), and opened up the files that are downloaded (and again, no warning in the installers).
    As a layperson I have trouble imagining that the coding/development of a PDF reader would be inconsistent to the  point that it breaks down trying to point to its own components..but that is probably an oversimplification.
    Hope that it is resolved, and that until then appropriate warnings are offered to end users.
    Thanks again for your time and interest.

Maybe you are looking for

  • Event CREATED is not triggered for objects of type USER

    Dear all, I'm currently configuring a workflow, which should be started when new user account is created. I took event CREATE for object type USER as a start event, but the workflow does not start, when I create new user account via transaction code

  • User Defined Fields for Users

    I am currently using OIM 11.1.1.3.0 I have created several UDFs via the 'User Configuration' tool in the advanced console. I can see these UDFs whenever I create a user, but afterwards, when I select the user to edit their information with the Xelsys

  • I don't see the bubble where people are typing in iMessage

    For some reason I don't see the little bubble where people are typing in iMessage. I've already tried it with other people in iMessage, but I still don't see it. Can someone help me and resolve this issue for me?! Thanks.

  • The composite state is set to "off". The composite can be turned "on"

    Hello, I had deployed a composite in weblogic 10.3 from Jdeveloper 11.1.1.6.I am grtting this error. Can you help me to sort this out and this is in Active state only. oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from

  • Org.jdom.input.JDOMParseException: Content is not allowed in Prolog.

    I got the above error. I am trying to save my query xml file in my tempdir (under local settings)..done that by using file.createTempFile() method in java. To my surprise, when my xml file is stored in my current dir, it is reading it well and proces