How to get JTextPane partially non-editable?

Hi,
I am trying to get parts of the JTextPane (that have clearly different styles than regular text) to be non-editable. So far I cannot make a partial setting like this. Netbeans (FFJ) source file editor has a feature like this, but I have not been able to locate their implementation in the source files. Once can move the caret inside the non-editable part, and even select text, but no editing is allowed.
Does anybody know how to set this up?

Here's the answer I found in 10 minutes, after having the time to take a look into it:
The non-editable text (section headers) are blue and bold. So here's the event handler for KeyEvent:
private void textAreaCommandKeyTyped(java.awt.event.KeyEvent evt) {
AttributeSet aSet = textAreaCommand.getCharacterAttributes() ;
boolean bold = StyleConstants.isBold( aSet ) ;
if ( bold ) {
Toolkit.getDefaultToolkit().beep();
evt.consume() ;
}

Similar Messages

  • How to set the field non-editable in the classical report..

    Hi..
              How to set the field non-editable in the classical report..

    Hi experts,
    For the component 'ICCMP_EMP_SRCH' there is a view 'BUPAEMPSEARCH' , which has 2 context nodes 'CUSTOMER' AND 'SEARCHEMPLOYEE' , i need to add the field 'NICKNAME' which is part of the 'CUSTOMER' context node on the search screen. Currrently all the fields on the screen screen are from the 'SEARCHEMPLOYEE' context node. when i did the configuration , the 'NICKNAME' field is greyed out . I have already generated the Getter ,Setter , GET_I, GET_M methods for the 'NICKNAME' field and the context node and controller class and context class are all active .
    on debugging the GET_I method, i see that rv_disabled = 'TRUE' and the current = collection_wrapper->get_current( ) is returning empty value .
    for this rv_disabled to be set false , the code below is not triggered since there is no value in current.
    IF current->is_property_readonly(
    'NICKNAME' ) = abap_false. "#EC NOTEXT
    rv_disabled = 'FALSE'.
    ENDIF.
    when i check for other search fields of context node 'SEARCHEMPLOYEE' , all the fields are set to rv_disabled = 'FALSE'.
    can anyone suggest how to approch this. iam i missing any binding between context nodes or any activations ?
    The field properties are set as Input field and the display checkbox is not checked.

  • How to create a secure & non editable PDF? So that it cannot be modified by any of the secondary too

    How to create a secure & non editable PDF? So that it cannot be modified by any of the secondary tools available online for security breaks and editing of PDF document
    I put all the security options but still there are tools to break the security (even password) leading to editing of document
    Need to avoid any such situation

    If the document is important, and there is something to be gained by modifying it - then someone will just make a new copy of it (e.g. print and scan, screen capture), and make a new document, then change it.
    If protecting the integrity of the document - proving it is unchanged - is the thing, look at digital signatures. Forget security, the signed file can be freely edited, but the signature will always show it is changed.

  • HOW TO MAKE TABLE CONTROL NON EDITABLE

    hi all
    how to make table control non editable
    Thanks & Regards
    harsha

    Hi,
    Try this code in the PBO inside the module in the LOOP...ENDLOOP.
       IF SY-TCODE EQ 'ZEMPLDISPLAY'.
        LOOP AT SCREEN.
         if screen-name eq 'column1' or screen-name eq 'column2'.  "Give the names of the columns in the table control
          SCREEN-INPUT = '0'.
          MODIFY SCREEN.
        endif.
        ENDLOOP.
      ENDIF.
    Or you can go the Layout of the table control in Change mode and for every column's attributes, make it 'Output' only field. Check  'Output only' field.

  • I had a "pdf export" plan and upgraded it to "pdf pack" plan and it was charged the full price of the new plan in my credit card. How to get back the non used part of the old plan?

    I had a "pdf export" plan and upgraded it to "pdf pack" plan and it was charged the full price of the new plan in my credit card. How to get back the non used part of the old plan?

    Hi edilsoncf,
    I've seen your question on several forums, and responded there. Did you get your subscription sorted out?
    See: How do I get a refund if I have multiple Acrobat service subscriptions?
    Best,
    Sara

  • How to make a field non-Editable in Web UI

    Hello Experts,
    I am new to Web UI CRM 7.2. Could anyone pls guide me in making a field non-editable on Web UI.I have the field in one of the custom assignment block. Could you pls guide me with some sample code how to achieve this ?
    Thanks in advance.

    Hi experts,
    For the component 'ICCMP_EMP_SRCH' there is a view 'BUPAEMPSEARCH' , which has 2 context nodes 'CUSTOMER' AND 'SEARCHEMPLOYEE' , i need to add the field 'NICKNAME' which is part of the 'CUSTOMER' context node on the search screen. Currrently all the fields on the screen screen are from the 'SEARCHEMPLOYEE' context node. when i did the configuration , the 'NICKNAME' field is greyed out . I have already generated the Getter ,Setter , GET_I, GET_M methods for the 'NICKNAME' field and the context node and controller class and context class are all active .
    on debugging the GET_I method, i see that rv_disabled = 'TRUE' and the current = collection_wrapper->get_current( ) is returning empty value .
    for this rv_disabled to be set false , the code below is not triggered since there is no value in current.
    IF current->is_property_readonly(
    'NICKNAME' ) = abap_false. "#EC NOTEXT
    rv_disabled = 'FALSE'.
    ENDIF.
    when i check for other search fields of context node 'SEARCHEMPLOYEE' , all the fields are set to rv_disabled = 'FALSE'.
    can anyone suggest how to approch this. iam i missing any binding between context nodes or any activations ?
    The field properties are set as Input field and the display checkbox is not checked.

  • How to make report output non editable

    Hi can any body give me sample code on how to make the report output non editable.
    thanks in advance
    kp

    Hi
    What are you meaning?
    U don't want to allow to change the data in the selection-screen?
    If it's so:
    AT SELECTION-SCREEN OUTPUT.
       LOOP AT SCREEN.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
      ENDLOOP.
    If you need to change only certain fields:
    PARAMETERS: P1 ......,
                P2 ...... MODIF ID AAA.
    SELECT-OPTIONS: SO_1 FOR .....,
                    SO_2 FOR ..... MODIF ID AAA.
    AT SELECTION-SCREEN OUTPUT.
       LOOP AT SCREEN.
          CHECK SCREEN-GROUP1 = 'AAA'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
      ENDLOOP.
    Max

  • How do I save a non editable version of a form

    I want to make a form non-editable after I have filled in the fields. How do I do this?

    With Reader your options are very limited. Basically the only thing you can do is to digitally sign the document, which can lock the fields and prevent them from being edited while the signature is still valid.

  • How to get "Double-click to edit" behavior in fields added to Master slides

    Hi! I edited a master slide to add a box of Placeholder Text. Now the word "Text" appears whenever I make a new slide (child of the master), which is fine. But if I don't change the text on a particular slide, the word "Text" shows up there when I run the slideshow. This is different from the behavior of the Apple-defined placeholder text, where the phrase "Double-click to edit" does NOT appear when you run the slideshow.
    I've searched the help files and tried various Inspector settings, but cannot seem to get this wonderful timesaving feature working for my own Master Slide fields. Is it possible?

    I was just looking for a solution to this... how timely! The closest I found to being able to have an "apple-defined placeholder" is by following all your steps (editing master, making new text box), but then doing the following:
    1) select the text box
    2) go to the "Format">"Advanced" menu and select "Define as Text Placeholder."
    This isn't the same, since the text will always show up on the slides (as opposed to only showing up if YOU wrote something in the box... you can delete it if you want, but its not the same as apple's default), but it does have the functionality you want. I hope this helps you!
    EDITED TO ADD:
    ...aaaand the age-old trick of reading the manual works again. Go to page 188 of the linked document and you'll see that there's a different way to do it. In short:
    1) Make a text box in a master slide, keep it selected.
    2) In the Inspector, go to "slide inspector" (second from right), and select the "appearance" tab.
    3) Check the checkbox next to "Define as Text Placeholder." Assign it a tag.
    For me, I found that once I did this, I could delete the text inside the textbox and it wouldn't automatically be deleted. I assume that assigning it a tag has something to do with that. I still don't know how to get text to automatically show up in the textbox... that seems to be a special functionality reserved for the apple-defined boxes. Again, I hope this helps!
    Message was edited by: Eliezer Kanal

  • How to get the last value edited by users from JTable?

    Hi.
    I have a JDialog that includes an editable JTable. This table is used to set up field caption and font for a report program. I found only when cursor is moved to another cell, the value in current cell being edited will be transferred to Table Model. So if the user don�t move cursor to another cell after editing the value of a cell but click OK button directly, Table Model cannot get the last value edited by the user, I wonder if there is a way to fire JTable to transfer the value being edited to Table model.
    By the way, I found if the TableCellEditor is using JCheckBox or JComboBox instead of JTextField, there is no this problem.
    Thank you for any reply.

    I guess you can make use of the following methods on your table model to inform it make it getValueAt bcos table data has changed.
    fireTableCellUpdated
    Notifies all listeners that the value of the cell at [row, column] has been updated.
    fireTableChanged
    Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.
    fireTableDataChanged
    Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the JTable should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same.
    But when to call these methods??
    -- When OK button is pressed, do this as the first thing!!
    OR
    -- Call this on every key event!!
    regds,
    CA

  • How to get only partial text of a paragraph into the table of content?

    Hi guys,
    currently I'm working on a manuscript based on the publication manual of the American Psychological Association.
    Unfortunately, there is some sort of heading that's placed right in front of further text. Here an example:
    +This is my heading.+ Now ordinary text formatted differently should follow.
    Does anyone here know, how to get the text of the heading (but not the following text) into the table of content? For as far as I know I can't format the heading as a different paragraph than the following text.
    By the way, I use pages'08.
    Thanks for your help

    Hi Dennis,
    thanks for your suggestion, unfortunately I already tried that and it didn't work. I have created several unique styles. Problem is, I need two diferent styles in *one paragraph* - one style for the "heading", which is consistent to the APA manual not an own paragraph (sorry, not my idea...), and another style for the following text. As my example above shows, the heading is followed by usual text and I may not press return after the heading and switch to a new paragraph..
    It has to look exactly like this:
    +heading in italics.+ Now heading is followed by usual text without changing the paragraph or starting a new line. Blurb blurb blurb whatsoever blurb blurb. The text goes on an on and an on you see.
    I can't format the heading differently than the text (because if I try, the whole paragraph is formatted this way) and so I can't add just the heading to the TOC. Do you see what my problem is? Got any other suggestion?

  • How to  Get CL_HTMLB_MANAGER Document----English edition

    Hi:
    System message:
    "Document CL_HTMLB_MANAGER is not available in language EN"
    How to get the english Document of BSP class and interface?
    where can i download it?

    check this weblog.
    it explains most of the utility classes and its methods.
    /people/thomas.jung3/blog/2005/01/13/bsp-utility-classes
    Regards
    Raja

  • How to make a row non-editable depending on a db column value

    HI,
    I've an editable report region and the requirement is to make the row non-editable according to the value in one of the column. Like if the value for that column is null the row should be editable else non-editable. Any option to do this in Oracle APEX.
    Regards,
    Prasanth

    I assume you are using a tabular form. In that case, you would have to run a loop in Javascript to read all the rows in the Form. The example is given below. You can use Firebug in Firefox to identify your field names and replace f02, f03 and f04 with your field names.
    <script language="JavaScript" type="text/javascript">
    function f_readonly_items(){
    for (i=0;i<document.wwv_flow.length;i++)
    if (document.wwv_flow.f02.value) != Null
    document.wwv_flow.f02[i].readOnly = true;
    document.wwv_flow.f03[i].readOnly = true;
    document.wwv_flow.f04[i].readOnly = true;
    </script>
    Hope this helps.

  • How to get print shop premier edition 5.0 to work on 8.1

    Hello,
    I have several old programs from broderbund --- print shop premier 5.0 and print shop signature greetings that
    I would like to load and get to run on 8.1 but they do not seem to work.
    Any one know how to get these programs to work on 8.1.
    Thank You

    Diggin4it, welcome to the forum.
    Here is a guide to help you use Windows 8.1 Compatibility Mode.  It has been around in other versions of Windows, but is a bit different to access in Win 8.1.
    Please click the "Thumbs up + button" if I have helped you and click "Accept as Solution" if your problem is solved.
    Signature:
    HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
    HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
    HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
    HP Photosmart 7520 AIO
    ++++++++++++++++++
    **Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
    Intelligence is God given; Wisdom is the sum of our mistakes!
    I am not an HP employee.

  • How to Get ZERO and Non-ZERO Values in rowcount using Group by?

    Dear All,
    How can I get Non-ZERO and ZERO row count values in SQL using Group by? I can get non-zero values but when I want NULL should be returned to non-zero values it is ignoring ZERO values in output?
    Any hint?
    Thanks
    GQ

    Hi,
    Something like
    select count(case col
                    when 0
                    then 1
                  end) zero_count,
           count(case nvl(col,1)
                    when 0
                    then null
                    else 1
                  end) nonzero_countRegards
    Peter

Maybe you are looking for