Problem: Copy&Paste DocumentSizeFilter not working when pasting from Word

Dear all,
I have an application (Ekit HTML Editor) that I am customizing to satisfy my needs: I need a DocumentSizeFilter to stop the users from entering too much information. The filter already works when I paste plain text from other Windows applications into the JTextPane (i.e. it recognizes the insertion and stops if too much text would be inserted). The problem is: When I do a c&p from MS Word, the DocumentSizeFilter seems not to recognize the insert (only an insertUpdate in the DocumentListener event is fired as it should) leading to an insertion of the pasted information although the text is too long.
My question is now: Do I maybe have to implement a "special" DocumentSizeFilter for the case of the insertion of HTML data (I think MS Word pastes its information to the clipboard as HTML)? Or can somebody point me in the right direction what I did oversee here.
The JTextPane contentType is: "text/HTML"
Thanks in advance
Jan Peters-Anders

You're probably doing something wrong, because I can get this to work normally.
Have you installed the filter in the document correctly? Have you looked [java tutorials for text components|http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html]?
Anyway, both your code and java tutorials one forgot to check 'str' for null at replace function. As describe in the API:
API wrote:
text - Text to insert, null indicates no text to insertTry posting a SSCCE that demonstrates your problem.
Regards,

Similar Messages

  • TS3276 My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    Sorry for the delay...
    I did what you've told me, new account and manually copied my files from Time Machine. I had lots of permissions problems, but at the end, almost everything is in order... It seems it had to be with some of the Apple Preferences, but I can't be sure, as most of them were dumped to the trash can.
    I still don't have my Mail Rules back, unfortunately, although I did goggled some. It is a pity, as I had around 30 or 40 of them, getting my mail in order to each of its mailboxes, but it is a small price as the rest doesn't show the before syntoms.
    Thanks for the help, anyway!!

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

  • Managed Attachments - I/PM is not working when called from EBS

    Hi.
    When we click on "Managed Attachments" I/PM login screen should be populated. It was working fine before... Today, it is not working as expected. The following exception is coming in I/PM console logs...
    *<Dec 18, 2011 5:00:23 PM GMT+04:00> <Error> <oracle.wsm.policymanager.bean.util.PolicySetBuilder> <BEA-000000> <The policy referenced by URI "oracle/wss_username_token_ service_policy" could not be retrieved since Policy Manager is not deployed. oracle.wsm.policymanager.PolicyManagerException: WSM-02054 : Failure in looking up EJB component DocumentManager#oracle.wsm.policymanager.bean.ejb.IRemoteDocumentManager.*
    Caused By: javax.naming.NameNotFoundException: While trying to lookup 'DocumentManager#oracle.wsm.policymanager.bean.ejb.IRemoteDocumentManager' didn't find subcontext 'DocumentManager#oracle'. Resolved ''; remaining name 'DocumentManager#oracle/wsm/policymanager/bean/ejb/IRemoteDocumentManager'
    I think its the problem with Security Providers... We are using the default only... not using any LDAP etc... when we check in Enterprise Manager it is showing the store type as FILE for "Policy Store", "Credential Store", and "Key Store"....
    The same exception is coming when we test the webservices under Imaging deployment in Weblogic Console...
    Not sure how to crack it...
    Anybody please help!!

    The issue has been resolved by configuring Oracle Web Service Manager security policy as per the doucment 1332250.1
    Oracle Web Services Manager (OWSM) is necessary for applying WS-Security headers to UCM web services. The WebLogic domain that UCM/IPM runs in must have OWSM installed in order for this to work. OWSM can be selected upon domain creation, or added to a domain by extending the domain.

  • HR_INFOTYPE_OPERATION not working when called from Dynamic action

    Hi ,
           Senario  : I would like to execute a form from dynamic action which
    creates a record in 0015 (Additional payment IT) .
           I have writen the code as shown below am using FM HR_INFOTYPE_OPERATION
    . When i execute the program from se38 it is creating a record, however it is
    not created when it is called from dynamic action..when i debugged the code in
    inside the FM HR_INFOTYPE_OPERATION there is a FM HR_MAINTAIN_MASTERDATA where
    they are using call dialog (statement) and
    sy-oncom = 'N'   when called from Dynamic action and
    sy-oncom = 'S'   when called executed directly.
    I tried to change the sy-oncom to S while run from Dynamic action it created
    the record.
    So Can anyone explain me abt sy-oncom and how can i resolve the issue..
    code..
    REPORT ZHRPYENH01 .
    perFORM TERMIATION_9000.
    INCLUDE DBPNPMAC.
          FORM Termiation_9000                                          *
    FORM TERMIATION_9000.
    INFOTYPES : 0015.
    *data : i .
    *i ='c'.
    *break-point.
    *message i000(000) with i.
      TABLES : PRELP.
      DATA : P9000 TYPE PA9000." with header line.
      DATA : P0000 TYPE STANDARD TABLE OF  P0000 WITH HEADER LINE.
    DATA : P0015 TYPE STANDARD TABLE OF  P0015 WITH HEADER LINE.
      DATA : HIRE_DATE  LIKE SY-DATUM,
             TERM_DATE  LIKE SY-DATUM.
      DATA : MOLGA LIKE T500L-MOLGA VALUE '25',
             SEQNR LIKE PC261-SEQNR.
      DATA : RGDIR TYPE STANDARD TABLE OF PC261 WITH HEADER LINE.
      DATA : ACTUAL_PERIOD LIKE PA9000-RETENTION.
      DATA : PNP-SW-FOUND TYPE SY-SUBRC ,
             PNP-SY-TABIX TYPE SY-TABIX.
      DATA : TER_PERNR LIKE PA0001-PERNR.
      DATA : REF_PERNR LIKE PA0001-PERNR.
      data : key type BAPIPAKEY.
      data : payed_amount type p0015-BETRG.
    data : future_payment_amount type p0015-BETRG.
    data : p0002 like pa0002.
      types : begin of t_deduction ,
              deducation_date like p0015-begda,
              future_payment_amount type p0015-BETRG.
      types : end of t_deduction.
    data :  future_deduction type standard table of t_deduction with
    *header line.
      data :  future_deduction type  t_deduction .
    data : RETURN type  BAPIRETURN1.
    *data : deduction_p0015 like standard table of p0015 with header line.
    data : deduction_p0015 like p0015 .
    xxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxx
    ****Prepare 0015 data for deduction
    *deduction for payed amount
    clear deduction_p0015.
    *refresh deduction_p0015.
    deduction_p0015-pernr = REF_PERNR.
    *deduction_p0015-pernr = TER_PERNR.
    deduction_p0015-lgart = 'M120'.
    deduction_p0015-begda = sy-datum + 1 .
    deduction_p0015-endda = sy-datum + 1 .
    deduction_p0015-BETRG = payed_amount.
    deduction_p0015-WAERS = 'SGD'.
    deduction_p0015-ZUORD =  TER_PERNR.
    *append deduction_p0015.
    **deduction for future payment amount
    *loop at future_deduction.
    *clear deduction_p0015.
    *deduction_p0015-pernr = REF_PERNR.
    **deduction_p0015-pernr = TER_PERNR.
    *deduction_p0015-lgart = 'M120'.
    *deduction_p0015-begda = FUTURE_DEDUCTION-DEDUCATION_DATE.
    *deduction_p0015-endda = FUTURE_DEDUCTION-DEDUCATION_DATE.
    *deduction_p0015-BETRG = future_deduction-future_payment_amount.
    *deduction_p0015-WAERS = 'SGD'.
    *deduction_p0015-ZUORD =  TER_PERNR.
    *append deduction_p0015.
    *endloop.
    Create a deduction wage type in 0015 for the employee
    break-point.
    CLEAR RETURN.
    CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
      EXPORTING
        NUMBER              = REF_PERNR
        VALIDITYBEGIN       = '18000101'
    IMPORTING
       RETURN              = return
    if not return is initial.
    message E000(000) with
    'Referred Employee could not be locked for referal  payment deducation,
    please try after some time'.
    endif.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY                  = '0015'
        NUMBER                 = REF_PERNR
       SUBTYPE                = 'M120'
      OBJECTID               =
      LOCKINDICATOR          =
       VALIDITYEND            = SY-DATUM
       VALIDITYBEGIN          = SY-DATUM
      RECORDNUMBER           =
        RECORD                 = deduction_p0015
        OPERATION              = 'COPY'
      TCLAS                  = 'A'
       DIALOG_MODE            = '2'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
    IMPORTING
       RETURN                 = return
       KEY                    = key
    break-point.
    COMMIT WORK.
    if not return is initial.
    *return-TYPE
    *ID
    *NUMBER
    *MESSAGE
    message I000(000) with return-MESSAGE.
    endif.
    CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
      EXPORTING
        NUMBER              = REF_PERNR
        VALIDITYBEGIN       = '18000101'
    IMPORTING
       RETURN              = return
    xxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxx
    Thanks and regards
    -Senthil Bala
    Message was edited by: senthil bala

    Hi Senthil
    Why at all U want a subroutine to create a record in IT0015 through Dynamic action.There are some standard codes available to update infotypes.
    Let me give U an example
    14     9CON     BETRG     4     2     I     INS,0015 This will create a record in IT0015 when IT0014 is updated with Wagetype 9CON
    14     9CON     BETRG     4     3     W     P0015-LGART='5400' Set wagetype for IT0015(Here U can use a subroutine call to set the wagetype)
    14     9CON     BETRG     4     4     W     P0015-BETRG=P0014-BETRG set amount for IT0015(Here U can use a subroutine call to get the amount)
    14     9CON     BETRG     4     5     W     P0015-BEGDA=P0014-ENDDA set the dates(Here U can use a subroutine call to set the dates)
    Hope this will help U.
    Please award points if helpful

  • Picture text not working when sent from iPhone to non iPhone

    Since this 6.1 update that I have told everyone not to update. My phone has been doing strange things and I have called and talked to apple and they said they have not heard anything about it. First off, when I try to send a picture text to someone that does not have an iPhone such as an android they either a) can't open it or b) it opens as a video and flashes off. They had no problems before this update. So today my iMessage stopped working. I deletes the messages I had and sent a test text to iPhone friends and it started working. I also went I to settings and added my email to iMessage. In doing this it got me to thinking that if this changed by itself maybe it had something to do with the SMS.  Which is turned on already. I turned off iMessage and sent picture text to non iPhone and it worked. I don't want to have to turn off and no all the time anyone else had this problems?

    Hi Steve,
    I have tried to export to epub 2 and 3. The video is MP4 (h264). It was working just fine on all devices now I can't seem to get any video to export and work.
    Pretty sure it all stopped working after the Yosemite upgrade on the Mac or iOS 8 on devices. Or maybe both.
    Oddly, it plays in iBooks on my mac, just not on the iPad or iPhone.
    I've also tried to just export a couple of short test epubs with vids in different formats but get the same result....not working.

  • Fingerprint login not working when resumning from sleep

    Hello,
    I changed HDD to SSD and did *fresh* install, not from rescue discs.
    Everything is working as expected except except fingerprint login -- instead of logging I got an error:
    The computer is locked. Only logged user can unlock it.
    Picture
    I got this error only when resumimng from sleep/hibernate, I can normaly use FPR when logging right after reboot or if I launch FPR software.
    Software were installed via Lenovo System Update, nothing manually, using Lenovo Fingerprint Software v.3.3.2.27
    Fingerprints are present from previous enrollment/installation.
    Any help appreciated,
    Boštjan
    Edit: forgot system info -- T500 2056-VL1 with Samsung 830 256Gb, Win 7 x64 Pro SP1

    Hey there Boštjan,
    Looking over some of the fingerprint reader solutions on the lenovo support site, I saw that they Fingerpring Software for your machine, the T500 Win 7 64 Bit is at version 3.3.2.50. It may be worthwhile trying this update to see if it resolves your issue. Here is the document ID, DS012806, you can put it in the search field and it should pull it up for you. Alternatively here is the web address.
    http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS012806
    Good Luck!

  • Open Form not working when called from When-Mouse-Click

    In our application to navigate to other forms we have created a feature where user selects the Forms from a LOV, the form id is returned to the text item and user needs to click the text item.....In the text item the Open form command is given
    This is not working
    The form builder throws an error
    Frm 92100 Connection interupted
    what could be the reason

    Code written in When-Mouse-click
    for item :boo_toolblk.nbt_nxtscr which contains the form id
    DECLARE
    p_name_id PARAMLIST;
    lv_param_name VARCHAR2(8):= :boo_toolblk.nbt_nxtscr;
    lf_next_form_id FORMMODULE;
    BEGIN
    Clear_Item;
    /*Create a parameter list named 'TEMPLT_PARAM'. First
    ** make sure the list does not already exist, then
    ** attempt to create a new list*/
    IF not Id_Null(Get_Parameter_List('TEMPLT_PARAM'))/*Returns a BOOLEAN value if the object ID is available*/
    THEN Destroy_Parameter_List('TEMPLT_PARAM');
    END IF;
    p_name_id:= Create_Parameter_List('TEMPLT_PARAM');
    /*Add a value parameter to an existing Parameter
    ** List */
    Add_Parameter(p_name_id,'templt_nxtscr',TEXT_PARAMETER,lv_param_name);
    Go_Block(Get_Form_Property(:system.current_form,FIRST_NAVIGATION_BLOCK));
    lf_next_form_id := FIND_FORM(lv_param_name);
    :PARAMETER.next_form := lv_param_name;
    IF lf_next_form_id.id is not null
    THEN
    Close_form(lf_next_form_id);
    END IF;
    Add_parameter(p_name_id,'previous_form',TEXT_PARAMETER,:SYSTEM.CURRENT_FORM);
    /* opens another form*/
    Open_Form(lv_param_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA,p_name_id);
    EXCEPTION
    WHEN FORM_TRIGGER_FAILURE
    THEN RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS
    THEN RAISE FORM_TRIGGER_FAILURE;
    END;
    Error :-
    Frm-92100 : Your Connection to the Server was Interrupted
    This may be the result of a networn error or a failure on the server.
    You will need to re-establish

  • Component Slider not working when loaded from another swf file

    I have a simple Flash application that uses a component Slider to increase or decrease the size of the text in a TextArea (ta). It works perfectly fine on its own, however, when I try to load the same swf file from another application, I get the following error...
    ReferenceError: Error #1069: Property fl.managers:IFocusManager::form not found
    on fl.managers.FocusManager and there is no default value.
    at fl.controls::Slider/thumbPressHandler()
    Code...
    import fl.events.*;
    import flash.text.TextFormat;
    ta.text = "Lorem ipsum dolor sit amet";
    var tf:TextFormat = new TextFormat();
    tf.color = 0xCCCCCC;
    tf.font = "Trebuchet MS";
    tf.size = 12;
    slider.addEventListener(SliderEvent.THUMB_DRAG, sliderChange);
    style();
    function style():void
        ta.setStyle("textFormat", tf);
    function sliderChange(e:SliderEvent):void
        tf.size = slider.value;
        ta.setStyle("textFormat", tf);
    Could the containing swf file that I'm loading the slider swf file in anyway effect the slider application? I don't quite understand why it works on its own, but not when loaded from another app.

    add a slider component to the main (loading) swf's library.

  • Workstation Bridge not working when Updating from 10041 to 10049

    I am using Workstation 11 on a Windows 8.1 Host
    All works well including Bridge network connections
    I loaded Windows tech Preview 10 version (before 10041)
    All worked apart from the Bridged network connections when using VMware workstation 11
    Then there was an update to 10041 and the bridged connection started to work but you could not access the physical network card on the host...some error
    Then somewhere the new update version was installed on my machine to version 10049
    Now I cannot configure bridge mode in my VMware workstation 11 it tells me there sre no un bridged host insdtsalled and when I look at the physical network card there are no protocols installed.
    Looks like I will have to go back to windows 8.1 pity
    When one thing is fixed another is broken

    I too has the same issue and I apprently tried to revert to 10041 from 10049 and it did not work.
    But I tried to these and it worked for me. I stopped all the VM's and in vmware networking removed all the adapters.
    Then tried to run the vmware 11 (latest) setup again and when it asked to install I choose repair and it did repaired and reinstalled the networking and after that I tried to create new virtual adapter and it worked and vm can able to browse internet. 
    VM

  • What r problems came related ABAP/4 work, when upgration from lower version

    Hi Experts,
    can i know information about upgration.
    what are problems came in ABAP/4 realated development,when upgration from lower version to higher version.
    Best Regards
    jai

    Hi Jayasunderreddy,
    I have gone through an upgradation project, which upgrades from lower version to higher version, there are some problem we could find and here are they:
    1) There were some syntax errors for the variables.
    sloution) we should relate them with new version variables and change them.
    2) There were some FM to be changed according to the version
    3) There were change in BDC also if the objects having BDC then we have to check whether it is functioning well or not, or the best way is to replace the BDC with BAPI, which is independent of version change, so further no problems if at all the version changes.
    Is this information ok..this is what we did for that.
    if you are satisfied then award the points.
    Thanks and regards
    Vipin Das V

  • Sub form not working when converted from adp to accdb

    Hi,
    We have migrated MS access 2003 (.adp) applciation to MS access 2010(.accdb). There are few functionalities in the application not working as expected. A form opens on a button click has two sub forms. Applications throws error when button is clicked. run
    time error 2467. The expression you have entered refers to an object that is closed or doesnt' exist.
    Form_frmmainform.frmsubform.Form.RecordSource = rs
    Main form contains sub form and that has another sub form within in. There was a query for the record source whcih ihave replaced with recordset.
    But it works fine in .adp version. Could any body help me in this regard
    Thanks in advance

    Hi All,
    Could somebody please help me in this regard.
    We have migrated MS access 2003 (.adp) applciation to MS access 2010(.accdb). There are few functionalities in the application not working as expected. A form opens on a button click has two sub forms. Applications throws error when button is clicked. run
    time error 2467. The expression you have entered refers to an object that is closed or doesnt' exist.
    Form_frmmainform.frmsubform.Form.RecordSet = rs
    Main form contains sub form and that has another sub form within in. There was a query for the record source whcih ihave replaced with recordset.
    But it works fine in .adp version. Could any body help me in this regard
    Thanks in advance

  • Unix script not working when executed from SAP PI communication channel

    Hi Experts,
    I am currently using the Run OS command after message processing functionality of the file adapter.
    However, the unix script doesn't seem to work when run via communication channel.
    The script runs properly when executed manually.
    The communication channel logs don't show any error as well.
    Do you have any ideas as to where the error might be.
    Thanks,
    Mike

    Hi All,
    Thank you for your replies. I appreciate this.
    @Anand, here is the script:
    #!/usr/bin/sh
    #version 1
    hostname=$(uname -a | cut -f 2 -d " ")
    MAILTO="[email protected] "
    homedir=$PWD
    echo $homedir | mailx -m -s "OB10 $hostname" $MAILTO
    /opt/java6/bin/jar -xvf OB10.zip
    ll | mailx -m -s "OB10 $hostname" $MAILTO
    What's puzzling me is that I am able to receive the email alerts.
    This means that the user has sufficient authorization to execute the script.
    But the unzip command is not working.
    I have seen the unzip work when run manually.
    Thanks,
    Mike

  • The catalog converter did not work when upgrading from elements 11 to 13

    The catalog did not work I repaired it tried again and nothing now the elements 11 and 13 organizers do not work.

    Photoshop Elements

  • Problem with phone line not working when BT Infini...

    I have  a weird problem I have no Broadband and no my phone is dead, however when I take out the Broadband cable from the socket my phone line then gets a dialing tone but still no broadband. Does anyone have any ideas?

    Try a different dsl cable. Sound like either the cable or the modem is shorting somewhere.

Maybe you are looking for

  • XML to DDL

    HI I'm using DBMS_METADATA.GET_SXML to retreive the dll in xml. Its in XML becuase I need a way to process each table's column, constraints etc, inidividually and xml nodes helps do this. Once processed the node(s) need to be transformed back into dd

  • I have an ipad mini with ios 7.1.1 it lags a lot and the lower part of the screen is shaky after updating to ios 7.1.1

    i have an ipad mini with ios 7.1.1 it lags a lot and the lower part of the screen is shaky after updating to ios 7.1.1

  • Dynamic-side Box? Can't read source code with java

    Hi all, I am trying to read a source code of a web page with a java program. I can connect to the page and read a part of the source code without any problems however after a while when it comes to a part where mozilla and opera identifies as "dynami

  • Using/updating symbols externally?

    Hi. The is probably a stupid question, but here it goes : - can symbols be linked externally, like with images in inDesign or Illustrator so that they update automatically?... Pedro

  • Help me, BDAqua... you're my only hope

    After my G4 MDD's power supply toasted last week, I'm scrambling to get everything moved over to my MacBook so I can keep working. A USB drive adapter is allowing me to transfer the contents of the G4's two internal drives (now removed) to an externa