Setting global action map and input map.

I was needing a way to set up the global inputmaps and actionmap. Currently I am grabbing the rootpane of the JFrame and manipulating the input maps there but I was hoping to be able to change the the input maps for whole classes of components such as adding a default to the UI some how so that all buttons respond to an 'Enter' key.
So far all the solutions invloved modifying individual components, nothing really looked like a way to modify the all JButtons or all JDialogs to add inputmaps/actionmaps.

Try this fun example.
Foucs the button. Press some random keys. Press the space key.
import javax.swing.*;
* @author Ian Schneider
public class UIInputDefaults {
    public static void main(String[] args) throws Exception {
        UIManager.getDefaults().put("Button.actionMap",new ActionMap() {
            public Action get(Object key) {
                Action retValue;
                System.out.println("action "+ key);
                retValue = super.get(key);
                return retValue;
        final InputMap original = (InputMap) UIManager.getDefaults().get("Button.focusInputMap");
        InputMap ours = new InputMap() {
            public Object get(KeyStroke keyStroke) {
                System.out.println("key " + keyStroke);
                return super.get(keyStroke);
        KeyStroke[] keys = original.keys();
        for (int i = 0; i < keys.length; i++) {
            ours.put(keys,original.get(keys[i]));
UIManager.getDefaults().put("Button.focusInputMap", ours);
JButton b = new JButton("Foo");
javax.swing.JFrame f = new javax.swing.JFrame();
f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
f.getContentPane().add(b);
f.pack();
f.setVisible(true);

Similar Messages

  • Setting output to onboard and input to USB interface ?

    Hi all,
    Does somebody now a way to "split" the input and output in logic?
    What I want is using my Alesis USB interface for the incoming signals and the onboard (headphone) output for the the master output. The reason is, when recording guitars through ie Amplitube, the Alesis interface is giving both the clean guitar input signal and the processed signal form Logic back on the output. There's no way to stop the clean input signal going to the output... IF there's a way to set the output to onboard, I only monitor the Logic output.
    In Garageband you can easily set both the input and output in Preferences, but Logic only gives me the option to select the soundcard for both in and output.
    I hope someone can help me out. Thanks a lot
    Kind regards,
    Martijn

    You may be able to configure your interface to do this...
    But if not, you can create an aggregate device (in Audio MIDI setup - may be in Applications>Utilities).

  • Global virtual channels and DAQmx AI inputs

    I would like to see and example linking global virtual channels and input configuration for DAQmx AI inputs.  The DAQmx input requires physical channels and not global virtual channels.

    Hello rlbrehm,
    If you are using a global virtual channel then you have alredy set up the input configuration, as shown here:
    So you simply need to set up timing and read, as shown here and in the attached VI:
    Message Edited by Dr. Doiron on 08-06-2009 02:55 PM
    With warm regards,
    David D.
    Attachments:
    Global Virtual Channel.vi ‏9 KB
    Input Config.jpg ‏176 KB
    VI.jpg ‏78 KB

  • Input maps and action maps

    i have an internal fram that has a delete action. i have another such frame, whic hsi generated form teh first frame (first frame is the second frame's parent).
    when i hit the backspace key in teh second frame, it performs the action formthe parent frame. i have nto been able to do anythgi nwith action maps or input maps or registering keys to make this not be the case.
    teh backspace needs to do the delete action of the SECOND frame, not hte FIRST!!!
    help please?

    this is what i am currently trying:
    ActionMap map = getActionMap();
    map.put(muxPanel.viewsList.delete.NAME, muxPanel.viewsList.delete);
    muxPanel.getInputMap(WHEN_IN_FOCUSED_WINDOW).remove(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
    muxPanel.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), muxPanel.viewsList.delete);

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

  • Problem in JSF action mapping for ZOHOwrter

    Hello Every one,
    I am struggling with a problem by using zohowriter in JSF Frame work, my problem is..
    I have developed an application to open and edit a Document which resides in server and save it in server in another path, for this purpose we are using ZohoWriter. For this application the Struts frame work is working fine.
    I have designed xhtml page by using struts framework as bellow,
    <body>
    <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor" target="_self">
    <input type="hidden" name="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc">
    <input type="hidden" name="saveurl" value="http://localhost:8080/Struts/zoho.do">
    <input type="hidden" name="filename" value="mydocument.doc">
    <input type="hidden" name="id" value="12345678">
    <input type="hidden" name="format" value="doc">
    <input type="hidden" name="persistence" value="true">
    <input type="submit" value="Edit" class="divbutton" name="submit">
    </form>
    By using above code that editor is calling the "saveurl" attribute value while saving the document, that is automatically executing the Action class and saving the Document in specified server path.
    But,
    In my application we are following JSF framework,
    In my application I have written the xhtml page like,
    <form id="myform" method="post" enctype="multipart/form-data" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor">
         <h:commandButton value="Edit" />
         <h:inputHidden id="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc" />
         <h:inputHidden id="filename" value="TestPlan.doc" />
         <h:inputHidden id="id" value="12345678" />
         <h:inputHidden id="saveurl" value="http://customers.info-sun.com/itrack/zoho.fileDownload" />
         <h:inputHidden id="format" value="doc" />
    </form>
    in the page designing if I use <h:form> this tag is not containing action attribute , so I am giving by command button but it is not working.
    So, I continued with html form.
    also, if I specify the "saveurl" attribute mapped with backing been , it is executing in page load only , So My actual intention means after editing it needs to call but it is not happening, while loading this method is calling so other problems are raising.
    Can any one please guide me that, what is my mistake and how to over come.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 9, 2009 7:37 AM

    Hi,
    I got solution for the above problem.
    I am calling a servlet instead of calling jsf flow, I got that, the zohowriter calling only lifecycle method for saveurl attribute.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 12, 2009 6:32 AM

  • How to get the action-mapping in jsp page in struts

    Hi,
    I want get, in my login.jsp, the name of action mapping that call my
    login.jsp.
    Is possible?
    suppose abc.do called my login.jsp
    now i need to know the name of action-mapping here abc
    Thanks,

    Depending on what you need, I believe Struts 1.3 creates a request attribute called "org.apache.struts.globals.ORIGINAL_URI_KEY". In your case, it looks like this would be set to the string "/abc.do". There should also be a request attribute called "org.apache.struts.action.mapping.instance" that contains an instance of ActionConfig. I think both of those keys are defined by the Globals class.

  • How to set up port mapping in airport extreme?

    I just buy a Ip cam (d link) which need to set up port forwarding for outside access.
    What can I do?  My ISP is netvigator.
    How to set up and input which address to the airport utility?
    Please help.
    Thanks!

    Mmm, generally you don't need to do much port mapping in an extreme. Not sure I understand you.  What does the d-link do?

  • CF10,0,11,285437 global UNC Mapping does not work?

    Maybe the way global UNC mappings are supposed to be added has changed?
    When I under ColdFusion 9 add the following mapping via the adminstrator interface:
    Logical Path = /SharedFiles
    Directory Path = \\webroot\sites\_SharedFiles
    The url http://somesite.com has it's path set to \\webroot\sites\somesite in IIS7.5
    Browsing http://somesite.com/SharedFiles/some.cfm renders the cfm fine, since the CF9 mapping for SharedFiles works without any issue.
    When I under ColdFusion 10,0,11,285437 add the following mapping via the adminstrator interface:
    Logical Path = /SharedFiles
    Directory Path = \\webroot\sites\_SharedFiles
    Again, the url http://somesite.com has it's path set to \\webroot\sites\somesite in IIS7.5
    First thing I notice as different is that CF10 shows the Directory Path as //webroot/sites/_SharedFile instead of \\webroot\sites\_SharedFiles
    Clicking EDIT still has the Directory Path exact as I wrote it thou...
    Browsing the url http://somesite.com/SharedFiles/some.cfm throws a 404 Not Found, since the mapping doesn't work with CF10, it points to \\webroot\sites\somesite\SharedFiles\some.cfm instead of what is specified in the mapping.
    This is rather critical when hundreds of sites are setup to use such a global mapping, and we can't really switch to CF10 before this works again.
    Message was edited by: F4798w85gasdg
    Added some red and blue color to make it easier to read

    Found something which I miss for CF10.
    In CF8 you can:
    Adding a virtual web mappingA virtual web mapping lets you map a physical system path to a logical resource path that might be outside the ColdFusion MX web root. For example, you might want to map the physical directory c:\myapp\resources\images to the logical resource path /images. After setting up the mapping, users access the directory using a URL in the following form: 
    http://hostname/images/ 
    One advantage to using virtual web mappings is that it hides the physical layout of your application directory structure from users.  
    To configure a virtual mapping: 
    1
    In a text editor, open the file web_root\WEB-INF\jrun-web.xml.
    2
    Create a virtual mapping.
    For example, the following entry maps the c:\myapp\resources\images directory on a Windows system to the virtual directory /images:
    <virtual-mapping>    <resource-path>/images/*</resource-path>    <system-path>c:/myapp/resources/images</system-path>    </virtual-mapping> 
    http://www.adobe.com/support/coldfusion/adv_development/config_builtin_webserver/config_bu iltin_webserver08.html
    Question is just if this can be done with C10 and where.
    EDIT: Found the solution, just had to add it as alias in server.xml's host context section

  • BIZTALK bts action mapping problem with Message Schemas for the Composite Operation

    Hi,
    I have a message schema made with the composite operation.
    now, I have re-deployed my biztalk project and in the send port for this Oracle composite message the SOAP action header hasn't updated the correct action.
    now I tried several verations for this soap action mapping and this is what I got:
    ><BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    >  <Operation Name="Select" Action="http://Microsoft.LobServices.OracleDB/2007/03/CompositeOperation" />
    >  <Operation Name="SQLEXECUTE" Action="http://Microsoft.LobServices.OracleDB/2007/03/CompositeOperation" />
    > </BtsActionMapping>
    Now as you can see the Composite schema has 2 operations one is from an Oracle VIEW and the second one is an Oracle SQL querry.
    please if someone could assist me with this issue?
    Message Schemas for the Composite Operation
    Message Schemas for the Composite Operation

    For Composite Operations you don't use the Action Mapping Xml for both the SQL Server and Oracle bindings.
    The Action for Oracle Composite Operations is:
    http://Microsoft.LobServices.OracleDB/2007/03/CompositeOperation
    by itself.  No Xml or anything.

  • I try to log into my user account but I set a master password and everytime I input the password it says login failed any suggestions?

    I am trying to login into my user account but I set a simple masterpassword and everytime I input the password it says login failed. Any suggestions?

    Or is it because I forgot my username?

  • How to set the gain and input coupling for each channel on a NI 4462 DaQ card?

    I've seen a few examples in how to set the gain for NI 4462, but none tell me how to chose the channel I wish to set this gain.  Also the same problem with input coupling
    Does anyone know how to set the gain and input coupling for each individual channel?
    Thanks,
    Hector
    LabView 8.5 Windows XP

    Hey Hector,
    http://forums.ni.com/ni/board/message?board.id=100&thread.id=1688
    This has a few examples of how to do that.  Let me know if you have further questions.
    Have fun!
    -gaving

  • One JSP Coded in JSTL with an Action Link and a Form

    My JSP written in JSTL with an action link works fine. The checkboxes are well recognized ( I have a "form" specified in both the action mapping and form bean).
    <%@ page import="......common.pojo.user.User" %>
    <!-- Create a variable in scope called userRows from the Users object -->
    <c:set var="userRows" value="${requestScope.Users}" />
    <c:choose>
         <c:when test="${not empty userRows}">
              <!-- create a "user" object for each element in the userRows -->               
              <c:forEach var="user" items="${userRows}" varStatus="idx">
                      <c:choose>
                              <c:when test="${( idx.count+1 )%2==0}">
                                 <tr class="contentCell1">
                              </c:when>
                              <c:otherwise>
                                 <tr class="contentCell2">
                              </c:otherwise>
                      </c:choose>
                                           <td align="center">
                                                              <html-el:checkbox property="selectedUsers[${idx.index}].selected" />
                                                              <html-el:hidden property="selectedUsers[${idx.index}].id" value="${user.id}"/>
                                           </td>
                                           <td align="center"><c:out value="${user.createdByUserID}" /></td>
                                           <td align="center"><c:out value="${user.firstName}" /></td>
                                           <td align="center"><c:out value="${user.lastName}" /></td>
                             </tr>
              </c:forEach>
                        <tr>
                             <td colspan="6" align="left">
                                      <html-el:link action="/admin/selectUsers.do">Edit Selected Users</html-el:link>
                             </td>
                           </tr>
                   </table>
              </c:when>
              <c:otherwise>
                   <center><H1>No User Found.</H1></center>
              </c:otherwise>
         </c:choose>
    ......But, if I add another form (form B) with some textfield(s) and a submit button in between the opening <c:when ...> and <c:forEach ... > tag, I get the "runtime" JSP error: "cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope".
    The form B also works well. And varStatus="idx" and var="user" still work. The complaint points specifically to the <html-el:checkbox property="selectedUsers[${idx.index}].selected" />. The getter method for selectedUsers[0].selected can no longer be recognized:
    <%@ page import="......common.pojo.user.User" %>
    <!-- Create a variable in scope called userRows from the Users object -->
    <c:set var="userRows" value="${requestScope.Users}" />
    <c:choose>
         <c:when test="${not empty userRows}">
                                    <html-el:form action="/admin/findUsers.do">
                                               // many textfields and a submit button
                                    </html-el:form>
              <!-- create a "user" object for each element in the userRows -->               
              <c:forEach var="user" items="${userRows}" varStatus="idx">
                      <c:choose>
                              <c:when test="${( idx.count+1 )%2==0}">
                                 <tr class="contentCell1">
                              </c:when>
                              <c:otherwise>
                                 <tr class="contentCell2">
                              </c:otherwise>
                      </c:choose>
                                           <td align="center">
                                                              <html-el:checkbox property="selectedUsers[${idx.index}].selected" />
                                                              <html-el:hidden property="selectedUsers[${idx.index}].id" value="${user.id}"/>
                                           </td>
                                           <td align="center"><c:out value="${user.createdByUserID}" /></td>
                                           <td align="center"><c:out value="${user.firstName}" /></td>
                                           <td align="center"><c:out value="${user.lastName}" /></td>
                             </tr>
              </c:forEach>
                        <tr>
                             <td colspan="6" align="left">
                                      <html-el:link action="/admin/selectUsers.do">Edit Selected Users</html-el:link>
                             </td>
                           </tr>
                   </table>
              </c:when>
              <c:otherwise>
                   <center><H1>No User Found.</H1></center>
              </c:otherwise>
         </c:choose>
    ......

    Hi,
    your strtus config file looks like
    <form-beans >
    <form-bean name="manageAuditFindingsForm" type="com.lib.struts.form.ManageAuditFindingsForm" />
    </form-beans >
    <action
          attribute="manageAuditFindingsForm"
          input="/New.jsp"
          name="manageAuditFindingsForm"
          path="/manageauditfindings"
          scope="request"
          type="com.lib.struts.action.ManageAuditFindingsAction">
          <forward name="success" path="/AuditFindings.jsp" />
        </action>Thanks
    Edward

  • Where is the hyphen (-) on the apple TV?  I am trying to set up my network and there is a hyphen in the password for the network

    Where is the hyphen on the apple TV?  I am trying to set up my network and there is a hyphen in the password for the network

    A few options to try:
    They hyphen should be next to the + on the character map.
    If you are still having issues, provided your ATV software is up to date, you can now connect an Apple Wireless Keyboard through bluetooth connections.
    Change your network password so it does not use a hyphen
    Good luck!

  • ADF Table filter issue with OR or AND input value

    Hi all,
    adf:table filterable fields for OR or AND input value not works. Actually One of column is for State and it has "OR" value for -> OREGON State.
    and I tried using filterModel and queryListener for table attribute. But I am not getting exact clue where I need to fix for this issue. Any suggestion and help is appreciated greatly.
    jdev version 11.1.1.3
    Thank you.
    - Robin

    Something like this might work for the one case:
    public void handleQuery(QueryEvent queryEvent){
        // Replace the OR with an equivalent condition
        Map m =
          ((FilterableQueryDescriptor) (queryEvent.getDescriptor())).getFilterCriteria();
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(), "OR"))
            entry.setValue("O AND _R");
        // Process The Query
        ELUtils.invokeMethod("#{bindings.VOQuery.processQuery}",
                             QueryEvent.class, queryEvent);
        // Put the OR back
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(),
                                           "O AND _R"))
            entry.setValue("OR");
    }

Maybe you are looking for

  • XML Publisher report not printing excel output due to special characters

    Hello, I am trying to create a xml publisher report which should display the output in excel. But the program completes with a warning status and the output is displayed as XML instead of excel, with some errors "An invalid character was found in tex

  • How to pass value to popup window

    Hi all, I think it is simple but i am not having clear idea about this. In my case, i have a table in which one column contains a command link. on pressing this link i will get details for any particular row. now when i am not using popup and showing

  • Interactive Reporting vs. Web Analysis

    Hi, I have been working at a client's location to create financial reports using Hyperion Financial Reporting (version 11.1.1.3). My client now has a requirement for dashboards for upper-management users. I did not see any features in Financial Repor

  • Accented character encoding in JNLP files

    Hi everyone: Maybe I am missing something trivial, but I am having trouble encoding French accented characters in my JNLP files. For example, I tried to encode the name "Québec" as follows: - Québec: the file is not parsed completely and the applicat

  • How to Create the Container

    Hi All, I know the 3 type of Container. 1. Abstract Interface 2. Simple XSD Data Type and 3. Receiver. Here My dought is Which secnarios we have to create this 3 containers... Please give me Clear idea .. It's usefull to me whenever i am doing BPM...