Overriding default Copy behaviour of StyledEditorKit

hi,
just executing the default behaviour of "copy" (i.e. the Action associated with the string DefaultEditorKit.copyAction), inherited from DefaultEditorKit, turns Styled text into plain text.
So I need to override the behaviour of this action in StyledEditorKit... I find the way into this must be use of the nested class of DefaultEditorKit, i.e. class DefaultEditorKit.CopyAction.
But can someone provide a code example on how to do the override... ? Have tried extending a CopyAction class in a StyledEditorKit constructor... etc.
Thanks
Mike

By the way I don't read code that has been posted
without the "Code Formatting Tags, found in the
"Formatting Tips" link.great, much better:
System.out.println();
Action doNothing = new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
        //do nothing
ActionMap actionMap = getActionMap();
for( InputMap inputMap = getInputMap(); inputMap != null; inputMap = inputMap.getParent() ){
    System.out.println( "input/action maps level..." );
    KeyStroke ctrlC = KeyStroke.getKeyStroke( KeyEvent.VK_C, Event.CTRL_MASK );
    String nm = (String)inputMap.get( ctrlC );
    if( nm != null ){
        System.out.println( "inputMap entry found for Ctrl-C: " + nm );
        inputMap.put( ctrlC, "doNothing");
        if( actionMap != null )
            actionMap.put( "doNothing", doNothing);
        nm = (String)inputMap.get( ctrlC );
        System.out.println( "now: inputMap entry " + nm + " present" );
        if( actionMap != null )
            actionMap = actionMap.getParent();
        if( actionMap == null && inputMap.getParent() != null )
                System.out.println( "hmm... actionMap parent null and inputMap parent non-null!!" );
Well, you should not be trying to get rid of the
deault Action.
You are adding your own custom Action, so you just
need to create you Acton and add the Action to the
ActionMap with the correct KeyStroke. that's what I do in the above code... despite replacing the "copy-to-clipboard" with doNothing in all 3 generations of ActionMap, the Action for "copy-to-clipboard" still appears to be present... and to de-style text automatically

Similar Messages

  • Override default printing behaviour

    Hi all,
    I would like overriding the default printing delivery behaviour. What should I do in order to archive this? should I implement a java class? if yes, which class has have to be inherit from? and how to register the class such that this class is being called?
    Thx
    Reards,
    whching

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • Problem overriding default JSF conversion error messages

    Hello !
    I have a problem to override default JSF conversation error message. I have an inputText which is binded to BigDecimal attribute, so when I enter a character in that field I get this error message: "- Conversion failed."
    I think I need to register the message bundle in my faces config, and put the key of this error message to my properties file.. am I right ?
    Can somebody help me with this ? Which key I need to put into the properties file ?
    Miljan

    Get [Sun's Java EE tutorial |https://www.sun.com/offers/details/JavaEETutorial.xml?cid=20090723ZA_TACO_JVEE_0004] and read the relevant section so you don't have to guess what you need to do.

  • How to set Default COPYING for HP Officejet 6500A Plus to DRAFT Quality?

    How do I set to Default COPYING quality to DRAFT for HP Officejet 6500A Plus?
    This question was solved.
    View Solution.

    Hi,
    Tap Copy on the printer front panel, then tap the Settings button.
    Tap Quality and select Draft / Fast.
    Tap Set as New Defaults and then select Yes to confirm the changes.
    From now on draft quality will be used for copying unless any other quality will be selected.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How to set (default )copy paste func. to ctrl+insert to textfield.java 1.5

    how do I set default
    copy func. to ctrl+insert
    paste function shift+insert
    to a textfield in java 1.5

    Quit multi-posting the same question:
    http://forum.java.sun.com/thread.jspa?threadID=5183891&tstart=0

  • 10.4.11 Server - Can not change default permission behaviour

    Hello,
    I have a 10.4.11 Server running with a raid attached.
    I have the problem, that I can not change the default permission behaviour. POSIX is ticked but I want to use "Inherit permissions from parent". As the standard "group just read" POSIX behaviour is not what I want.
    The WGM does not give me the possibility to change the default permission. The Radiobuttons are grey and can not be changed.
    The Raid Volumes are formatted in HFS+ Journaled.
    Would be more than happy to get a hint.
    Thanks
    Edit: The SMB permission btw. can be changed.
    Message was edited by: shifty.aimless

    blindness...
    WGM - Sharing - ALL Share Points - mark the volume your share point is on - General - untick "Enable Access Control Lists on this volume".

  • Problem when overriding default skin of Flex

    Hi all,
    I tried to change the default style of Flex by redefining the css file. To Button, I add some different images to different status. Because Combo, ColorPicker are all inherited from Button, they all have the same style like Button has, even if I define new style for Combo as well.
    How to avoid this scenario? What is the right way to overriding default skin?
    Thanks and regards,
    Yan

    Hi there,
    I played around with skinning a few months ago too but I didn't run over this problem. Check this article: http://www.adobe.com/devnet/flex/articles/flex_skins.html I don't know how are you replacing the default icons but what I did, was to build my skins from scratch with the help of the template of Flex skins for Photoshop, saved each skin as a .png file and everything worked fine.
    With best regards,
    Barna Biro
    Blog: http://blog.wisebisoft.com

  • Override Default Page Activation Workflow

    Hello,
    I am trying to override the default handling of Authors requesting page activations.  By default, an Author that doesn’t have Replication privileges has the request sent to the Admin group.  We’ve created several workflows specifically for different groups since each has their own approval flow:
    CQ User Group                 CQ Workflow
    Consumer >>                     Consumer Approval Workflow
    eCRM >>                             Consumer Approval Workflow
    Business >>                        Business Approval Workflow
    I realize the Author could select the workflow from the Sidekick, but I need ot ensure the correct workflow is assigned if they simply click “Activate” from the Sidekick or the Site Admin (Websites) page.  What’s the best way to accomplish this – writing some sort of servlet, using the Dynamic Participant Step, something else?  The logic would be fairly straight forward – on activation request, check user group and assign page to pre-defined workflow and initiate.

    You can set this in version 5.1.
    Thanks,
    Michael
    Michael Girdley
    BEA Systems Inc
    "anil" <[email protected]> wrote in message
    news:399aba85$[email protected]..
    How we can override default error page (404) in WebLogic ver 4.5.1 ? Wehave already set property weblogic.httpd.errorPage.404=URL in
    weblogic.properties file , but it is not working with 4.5.1
    >
    We would like to have solution in properties setting, because changing thecode is not possible
    >
    Thanks in Advance
    anil

  • JTable :Setting the cell renderer overrides default behaviour

    I have a class renderer as shown below.
    I would like to apply this renderer to my cells in my JTable (see below):
    When I use "setDefaultRenderer" I get the behaviour I expect. Fx. that number columns a right aligned, dates show as dates etc. However when I use "setCellRenderer" it eems that the functionality of the superclass is overridden ??. Any explanation - anyone ?
          TableColumnModel  tcModel;
          JTable table
          tcModel = table.getColumnModel();
          Enumeration       enum;
          enum = tcModel.getColumns();
          /* This works */     
          table.setDefaultRenderer(Object.class,new renderer()); //The renderer works for all objects.
          while ( enum.hasMoreElements() )
             tColumn = (TableColumn)enum.nextElement();
             /* But this does not !!? */
             /* tColumn.setCellRenderer(new renderer());   */
    class renderer extends DefaultTableCellRenderer
       public Component getTableCellRendererComponent(
          JTable _table,
          Object _value,
          boolean _isSelected,
          boolean _hasFocus,
          int _row, int _col)
       Component cell = super.getTableCellRendererComponent(_table,_value,_isSelected,_hasFocus,_row,_col);
       return cell ;
    }

    I have a class renderer as shown below.
    I would like to apply this renderer to my cells in my JTable (see below):
    When I use "setDefaultRenderer" I get the behaviour I expect. Fx. that number columns a right aligned, dates show as dates etc. However when I use "setCellRenderer" it eems that the functionality of the superclass is overridden ??. Any explanation - anyone ?
          TableColumnModel  tcModel;
          JTable table
          tcModel = table.getColumnModel();
          Enumeration       enum;
          enum = tcModel.getColumns();
          /* This works */     
          table.setDefaultRenderer(Object.class,new renderer()); //The renderer works for all objects.
          while ( enum.hasMoreElements() )
             tColumn = (TableColumn)enum.nextElement();
             /* But this does not !!? */
             /* tColumn.setCellRenderer(new renderer());   */
    class renderer extends DefaultTableCellRenderer
       public Component getTableCellRendererComponent(
          JTable _table,
          Object _value,
          boolean _isSelected,
          boolean _hasFocus,
          int _row, int _col)
       Component cell = super.getTableCellRendererComponent(_table,_value,_isSelected,_hasFocus,_row,_col);
       return cell ;
    }

  • Overriding the default like behaviour in LOV

    Hi all;
    I would like to know if there is a straight forward way in LOV to make the search find the exact match rather than the like, this can be needed if the LOV searches for numbers not names
    regards

    1. Have the LOV VO query with Bind Parameters
    2. Write the initQuery method in Lov VO Impl to bind the parameter and execute the query.
    3. Write method in the LOVAM Impl to invoke the method written in 2 above and pass parameters.
    4. Have programmatic query true marked for the mappings for which you need the values in the Controller.
    5. Associate a Lov Controller to the region and invoke the method in the AM. Remember to pass parameters.
    6. This would ensure that the query is executed after associating bind parameters and you get the behaviour you desire.
    Regards
    Sumit

  • Overriding default printer margins

    I am having trouble controlling the margins on my reports. In the report builder i have them set as one thing, but when i run the report they get set to the default print settings on my machine of 1 inch. Is there a way to override a user's default printer settings when printing a report thorugh a browser??
    Thanks,
    Patrick

    Hi Patrick
    If I understand your problem correctly, Though you set the margin as say "0" in report, still you see a margin of 1.0 in the output.
    If this is the problem, the reason is Reports takes the hardware margin of your printer into account and adds to the margin you set in report.
    Generally this is what is the expected behaviour from the users
    In Reports 9i, you would see a way of controlling this by command line ignoreMargin
    Thanks
    Rajesh

  • Override Default Error Messages

    Hi,
    We are using ADF components and want to override the default error handling mechanism. The requirement to be precise, whenever we validate an input text for mandatory, we get the default error message which shows us a cross, displays "Error: A value is required" and then our message which we specified in the requiredMessageDetail. Our requirement is that on validation the system should display only our message, both on the <af:message and <af:messages level.
    Can someone please suggest a way of ovveriding the default behaviour of ADF Errors.
    Thanks and Regards,
    Lilly

    hi all,
    I got the solution for this
    please refer the link below
    Customize ADF component Skin
    thanks
    dhiraj

  • Override default margins

    I'm creating a single-page document, landscape orientation, and because I want most of the page filled with copy, I want top and bottom margins narrower than the default margins of Pages'09. I tried changing the margins in inspector, but I can't get around the default settings.
    Does anyone know how to override the default pages margins, top and bottom?

    phillip a wrote:
    Thanks. I did that, but I notice that my text is still inside the old margins. When I click on "show layout" I still see a box around the text. How do I get that box to expand -- or is Pages set up so that the box always retains the same dimensions?
    Phillip,
    Did you set all four margin settings to zero in the Document Inspector, Document tab? Did you set the margin stops on the Rulers to the extremes? Are all the margins on the Layout Inspector, Layout tab set to zero? Those are about all you options, as far as I know. I'm assuming that your text is all in the text layer of a Word Processing Template.
    Jerry

  • Suppressing default VK_DELETE behaviour in JTable

    Hi all,
    I'm trying to suppress the default behaviour of the JTable on some keystrokes (e.g. F2, DELETE) in order to have a parent component process them in a centralized fashion.
    So far I've done the following (within a subclass of JTable):
    getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("F2"), "none");This works fine in suppressing the default reaction to the F2 key, but fails when I try the same with DELETE. The keystroke is still being consumed when processKeyBindings(keyStoke, keyEvent, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, true) is called on my table (tested that by overriding the method).
    What really freaks me out is the fact that by default there is no key binding assigned for DELETE in the corresponding InputMap of JTable.
    Any ideas? Or is there something obvious I'm missing?
    Thanks in advance!
    Regards,
    Michael

    What happens in processKeyBindings is that nearly any key starts the editing of the current cell. There are several possibilities - none is really satisfying, though
    a) if you don't need to automatically start edits with any key disable that feature by setting the clientProperty "JTable.autoStartsEdit" to Boolean.FALSE
    b) if it's especially the DELETE you are concerned about consume it by binding it in the table's inputMap(WHEN_FOCUSED) to some dummy action that does nothing (not sure if the "none" consumes it - I tend to believe it doesn't) That's a bit rude...
    c) override processKeyBinding to filter out the DELETE - could have side effects because it prevents the whole chain of super's handling
    d) have a cellEditor that refuses to start edits on Delete - override editor isCellEditable(EventObject) to return false on such a keyEvent. That requires rather wide-spread changes
    Greetings
    Jeanette

  • Override default send from email id and attachment name in email delivery

    How to override the default send from email ID and attachment name to send an outbound document using Email Transport protocol in Oracle Integration B2B ?. I've seen that "[email protected]" and subject of the email message were used as send from email ID and attachment name respectively

    Ramesh,
    I set the send from email ID as Generic Identifier for host and send to email ID as Generic Identifier for trading partner and used it in the agreement. How ever still the email message is generated with "[email protected]" as send from email ID.
    However I noticed that the "FROM" field in the wire message is updated with the correct send from email ID which I used as the Generic Identifier for host.
    Please advise.

Maybe you are looking for

  • Using Adobe Photoshop with Apple OSX 10.5.1

    hi, when i try to use photoshop 7.0.1 with osx 10.5.1 i get the following error msg: 'an unexpected and unrecoverable problem has occurred because of a program error. Photoshop will now exit' there are other little problems like getting a spinning cu

  • Zip file read problem

    Hi iam jayakumar from Inatech(oracle partner).I want to read the zip, write the zip file and create the zip file from BPEL .Is it possible? or use only java embedding in bpel to achieve this? or any config changes required? normal file adapter not re

  • Wallstreet screen hard to read

    I can lighten the screen or increase the contrast but the words on the screen look faded. Any picture looks very over-exposed. I wonder if the problem is a video card. I'm not sure if there is a separate video card in the Wallstreet. Can anyone sugge

  • Is it possible to export simply the marker list in Logic Pro 8 ?

    Is it possible to export simply the marker list from a project in Logic Pro 8 ? I want to present just a marker/cue list for a homework assignment. Thanks for your help.

  • Localejbs not bound

    Hi all I need to create a little project that includes an ejb class. When I try to call it: DBConnectLocal connect = EJBHomeInstancer.getDBConnectInstance (); I receive exception: javax.servlet.ServletException: localejbs not bound EJBHomeInstancer i