Prevent text edition in some lines

Hi people,
I need to prevent text edition in some areas, like the NetBeans IDE generated code (for the visuals).
I think I must handle the user input and check if that line is avaible for edition.
How can I write this code?.
Thanks in advance.

Hi,
Please check the following URL for some functions that will help you achieve what you want. Also note however that the task of identifying which lines to restrict user input from and the actual restricting of user input would be left to you.
http://forum.java.sun.com/thread.jspa?threadID=608220
Hope this helps.
cheers,
vidyut

Similar Messages

  • How to read some lines from a text file using java.

    hi,
    i m new to java and i want to read some lines from a text file based on some string occurrence in the file. This file to be read in steps.
    we only want to read the file upto the first Occurrence of "TEXT" string.
    How to do it ,,,
    Kinldy give the code
    Regards,
    Sagar
    this is the text file
    dfgjdjj
    sfjhjkd
    ghjkdg
    hjkdgh TEXT
    ikeyt
    ujt
    jk
    tyk TEXT
    rukl
    r

    Hendawy wrote:
    Since the word "TEXT" is formed of 4 letters, you would read the text file 4 bytes by four bytes. Wrong on two counts. First, the file may not be encoded 1 byte per character. It could be utf-16 in which case it would be two byte per character. Second, even if it were 1 byte per character, the string "Text" may not start on a 4 byte boundary.
    Consider a FileInputStream object "fis" that points to your text file. use fis.read(byte[] array, int offset, int len) to read every four bytes. Convert the "TEXT" String into a byte array "TEXT".getBytes(), and yous the Arrays class to compare the equality of the read bytes with your "TEXT".getBytes()Wrong since it relies on my second point and will fail when fis.read(byte[] array, int offset, int len) does not read 4 bytes (as is no guaranteed to). Check the Javadoc. Also, the file may not be encoded with the default character encoding.
    The problem is easily solved by reading a line at a time using a BufferedReader wrapping an InputStreamReader wrapping a FileInputStream and specifying the correct character encoding.
    Edited by: sabre150 on Apr 29, 2009 2:13 PM

  • Converted single line text to multiple and want to have rich text editing in layout

    We had a text field in a site that was initially set as single line of text. We needed it to be bigger and also allow formatting. So I added the field into the page layout.
    Changing
    <SharePointWebControls:TextField id="habitat" FieldName="Habitat" runat="server"/>
    to
    <SharePointWebControls:NoteField id="habitat" FieldName="Habitat" runat="server"/>
    But it doesn't show any rich text editing options and displays the full html tags in the field.
    If I open the page in the edit properties screen instead, then the field displays as I want it with the rich text editing options available in the ribbon, and text showing as bolded instead of like this:
    <div>This is <strong>the </strong>habitat field.</div>
    This is a site using the 2010 Publishing template running in compatibility mode on a 2013 server.
    How can I get my page layout to behave the same way as the edit properties screen does?

    Hi,
    Here are two solutions for your reference:
    1. We can use the InputFormTextBox control to achieve it.
    <SharePoint:InputFormTextBox ID="habitat" RichText="true" RichTextMode="FullHtml" runat="server" TextMode="MultiLine" Rows="20"></SharePoint:InputFormTextBox>
    http://blog.qumsieh.ca/2009/01/13/how-to-add-a-rich-text-editor-to-your-custom-application-pages-or-web-parts/
    http://blog.mastykarz.nl/rich-text-editor-control-sharepoint-2010/
    2. We can use the RichHtmlField control to achieve it.
    <PublishingWebControls:RichHtmlField id="habitat" FieldName="Habitat" runat="server"/>
    http://msdn.microsoft.com/en-us/library/office/ms561507(v=office.14).aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to edit/modify a line of a text file using java io

    Hi every body
    I am new 2 java
    I am struck in editing a text file that ends with .dat
    I successfully added,viewed data of the *.dat file.
    but,I cannt edit,delete the lines that i need to do randomly.
    Here is the code i have written.
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.LineNumberReader;
    import java.io.RandomAccessFile;
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    public class ReadWriteFile {
         String id=null;
         String name=null;
         String dept=null;
         String doj=null;
         String adrss=null;
         public void WriteFile(String Id,String Name,String Dept,String Doj,String Adrss) throws IOException{
              File f=new File("TraineeDetails.dat");
             if(!f.exists()){
             f.createNewFile();
              BufferedWriter bw=new BufferedWriter(new FileWriter("TraineeDetails.dat",true));
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              System.out.print("Enter Id : ");
              Id=br.readLine();
              System.out.print("Enter name : ");
              Name=br.readLine();
              System.out.print("Enter dept : ");
              Dept=br.readLine();
              System.out.print("Enter doj : ");
              Doj=br.readLine();
              System.out.print("Enter adrss : ");
              Adrss=br.readLine();
              bw.write(Id+"::"+Name+"::"+Dept+"::"+Doj+"::"+Adrss+":END:");
              bw.flush();
              bw.newLine();
              bw.close();
         public static void main(String[] args) throws IOException {
              ReadWriteFile rwf=new ReadWriteFile();
              String TID = null;
              String TADRSS = null;
              String TDOJ = null;
              String TNAME = null;
              String TDEPT = null;
              rwf.ReadFile(TID,TNAME,TDEPT,TDOJ,TADRSS);
         public void ReadFile(String Id1,String Name1,String Dept1,String Doj1,String Adrss1) throws IOException{
              BufferedReader br = new BufferedReader(new FileReader("TraineeDetails.dat"));
              String s;
               while((s = br.readLine())!= null)
                 // Create string tokenizer
                    StringTokenizer st =new StringTokenizer(s, "::");
                      System.out.println("----------------------------------------------");
                      System.out.println("| Trainee Id: "+st.nextToken()             +"|");
                      System.out.println("| Trainee Name: "+st.nextToken()           +"|");
                      System.out.println("| Trainee Department:"+st.nextToken()      +"|");
                      System.out.println("| Date of Joining: "+st.nextToken()        +"|");
                      System.out.println("| Trainee Address: "+st.nextToken()        +"|\n");
                      System.out.println("----------------------------------------------");
               // Close file reader
               br.close();
    }     and here is the data i have written
    Trainee.dat*
    111::jain::roads::2-2008::Blore:END:
    123::tim::service::1-2000::delhi:END:
    444::faru::civil::3-2200::sanapur:END:
    555::niv::cse::10-2000::gnagar:END:
    999::linda::mech::6-2001::tnagar:END:
    258::yansi::geo::8-2002::rtnagar:END:
    656::hari::garrage::3-1000::uttarahalli:END:
    888::muni::hr::5-2009::ernakulam:END:
    007::bond::spy::2-1972::america:END:
    0123::landy::games::6-2003::hdp:END:
    678::maddy::pumbing::4-1999::dispur:END:

    kalanidhi2u wrote:
    I want to randomly access the file
    But i cannt access itmake it RandomAccessFile... RandomAccessFile
    I edited it
    but i cannt edit the file by using itBoth of these are contradictory.

  • Why can I not print from pages but can if I copy to text edit, I get "printer off line message " from pages ?

    Why can I not print from pages but can if I copy to text edit, I get "printer off line message " from pages ?  I use HP wireless printer .

    Are you sure you have the right printer?
    In UNIX/OSX printers are virtual links to devices and even with the same name can be trying to reach a printer via another network address, so it thinks it is another printer.
    Peter

  • Why does text/edit leave line spaces when using Oracle?

    This question is just not limited to Macbook Pro's I'm sure, but to Text/Edit as a whole. I find Apple's text/edit to very unusable cross-platform. It leaves line spaces when you copy and past code from it to an Oracle environment causing the code to execute incorrectly leaving errors (I deactivated all extra features and chose 'Plain Text'). Also, when you open a text/edit document in Windows the formatting that was used is lost (It shoud keep the formatting without the line spaces like Windows Notepad). For instance, it displays the code on 3 lines (depeneding how much code you have). This is pretty moronic for something that should be simple and usable without much effort.
    For people that use both platforms for web design and development, this text/edit is pretty unproductive. I had to search and find one that works, which I shouldn't have to do for something like this. I mean it's just a text/editor. Make it useful for what it is, instead trying to be different on this one. Save that for the other great applicatoins that Apple offers.

    Ok so in this example, I add a comma to the first paragraph (left window, circled in red). There is no change to the text flow in this paragraph... but as soon as I type the comma, the paragraph below it reflows, for no apparent reason.
    I've tried opening the file in CS5.5, and the same thing happens. (And it's happening throughout the entire 300 page book)
    - in this example, if I delete the comma from the first paragraph, the second paragraph remains changed - ie it doesn't go back to how it was.
    Why did Indesign suddenly change the justification setting in the 2nd paragraph?
    Thanks in advance for any suggestions!

  • Change background color during text edit mode

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

    THis is a wacky problem...
    I have a presentation template. The slide master has white copy in the title and black copy in the body/bulleted list.
    When I try to use the template and edit the title copy, the background color for editing that line is white, just like the text, so I can't see what I'm typing. I can't figure out how to change the background color during text edit mode so that I can actually see what I'm typing. Is there a way to make this transparent?
    For some reason, the body copy edit works fine: black text edited in either a white or transparent background color.
    help!

  • After saving a htaccess file, why the text is on one line

    hello all,
    I am a webmaster and some time I have to setup a htaccess file (.txt file)When I edit it with Textedith, I make a modification and I save it. Nothing works.
    When I open the same file with a PC, all the text is in one line. of course it will not work.
    Can some one tell me why the file is not saved in the format when I open it, so it saved in one line?

    TextEdit isn't the best choice for editing configuration files, since it doesn't use Unix line endings -
    I thought TextEdit did use Unix line endings (LF). The reason it is all one line on a PC is that PC's do not, and thus will only display new lines if line endings are Windows format (CR + LF).
    I don't think there should be any problem editing config files with TextEdit, but TextWranger is better, and it also easily handles file names that begin with a dot.

  • Howtomake part of text as bold or differnt color text edit-webdynpro abap

    Hi
    How to make part of text as bold or differnt color in text edit-webdynpro abap.
    If we can make it bold then it is ok....or else atleast we have make it into some other color of part of text.
    Note:
    I tried with class char utilities and able to solve the issues like new line and carriage return....but could
    not make this bold or different color.
    Also when I use formatedtextview, I can able to solve this bold issue but I cannot solve this newline or carriage return issue...?
    Can any one help on this ?
    Thanks in advance
    regards,
    Pons

    You have to use the FormattedText UI elements for such a thing.  That is their purpose. 
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3b/219141c1d0ae5fe10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/2772f505605447e10000000a422035/frameset.htm
    Supported Tags:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/08/5696420cc2c56ae10000000a155106/frameset.htm
    What kind of problem did you have with the Formatted Text?  Line breaks?  Did you try using the br tag?

  • Not able to use the Tab key to Tab indent when within a text edit window...

    Two questions please... First one is above for the tab function. In Safari I just need to press control+option+tab to indent a tab within a text edit box on a website. This function is being used more via cloud and mobile capability.
    Second... I can, in Safari, Copy and paste a site with tables. Works great in Safari. When I try to do this in FF I lose the formatting of the tables and it just give plain text without the tabled fields.
    I would love to use FF because the compatibility if much greater than Safari, but... I need my functionality as well to do my work to the best and quickest ability.
    Thank you

    Help About says I'm on 20.0.1
    Up until last week, I was able to use the tab key when typing emails and other multi-line text boxes.
    Suddenly the behavior of the tab key changed. This isn't the first time. It's been quite a while ago that the function of the tab key changed from indenting to moving around the page, then after some time it changed back to indenting.
    Can we get this fixed and leave it alone, please?
    I may give one of those add-ins a try, but my problem with add-ins is that they break when FF is patched or upgraded, then I'm left with out the solution they provide.
    Can we just fix Firefox, please?
    Thanks,
    Frank
    P.S. Another potential fix I came across suggested starting FF in safe mode to see if the problem goes away. It does not. It seems to be a change to FF that appeared after an update last week. On or just befor 24 Apr.

  • Track Text Edit tags get trounced when applying additional tag?

    Hi all,
    Just upgraded to FM9.
    I opened a doc that was originall created in FM8.
    I had (and still have) enabled tracking of text edits, and can see the FM8_TRACK_CHANGES_ADDED and FM8_TRACK_CHANGES_DELETED tags when I highlight text.
    However, when I apply an additional tag to text that has been changed, the new tag is applied, but both of those are lost. So initially, I have this:
         This is my originalnew text.
    After I apply a conditional tag to the entire line, I get this:
         This is my originalnew text.
    There is no trace of the FM8_TRACK_CHANGES_ADDED and FM8_TRACK_CHANGES_DELETED tags.
    I've verified that working with user-defined tags works as expected (additive), so is there a known issue with the built-in tags getting trounced?
    -Greg

    Yes, I thought the tag names would match the version too, that was a surprise.
    Hang on a minute, I should have tested FM8 before I wrote this. Yes, it does seem to be a bug with FM9 -- in FM8 it works as you had indicated: applying a different condition is an "additive" step and it doesn't blow away the track changes. Mea culpa, Greg.
    Not to split hairs, but I'm not quite sure I could agree that this is a bug,
    [continued ...]
    I think it's more that the track changes is working "as designed" -- the original was created with limited functionality and it isn't integrated into standard FM conditional text practices as well as it should have been when it was "rolled into" FM.  I keep thinking of the medical phrase "first, do no harm"...
    If you haven't yet done so, you might consider posting to the Framers list in case anybody in the community happens to have come up with some workarounds:
    http://lists.frameusers.com/mailman/listinfo/framers
    Sheila

  • How to optimize text editing performance in Flash Builder 4?

    I am running Flash Builder 4.0.0 (build 272416) on a Macbook Pro 2.4 Ghz with 4Gb RAM. I am experiencing extremely poor performance while simply editing moderately complex MXML files.
    By poor performance I mean noticeable lag between keystrokes. Type one char, wait 2 or 3 seconds on a 700 lines MXML with about 20 buttons, 2 AdvancedDataGrids, 1 text area. Fairly complex, but that's what I need.
    Opening said MXML file takes around 12 seconds.
    Saving said MXML results in around 8 seconds: no automatic building, nothing else being done.
    On trivial MXMLs there's still a noticeable lag while typing, around 0.5 seconds per char.
    At this point Flash Builder 4 is unusable for me: editing .as files is still decent, but for MXMLs is almost impossible to work with, as you can see from the numbers above.
    Is there *anything* I can do to improve text editing performance? I've disabled all sort of niceties (automatic completion, indentation and so on) in the prefs, sadly to no avail. This is a major inconvenience for us.

    You understood correctly:
    - I removed all Build Path > Source Paths
    - I moved those paths over to Library Paths > Source attachment
    I took inspiration by how the Flex SDK is added to the project. Flex and flex related frameworks (e.g. datavisualization lib)  also specify a Source Attachment under Lib Path. If I remove the source attachment I am not able to drill down into Flex code when I want to by Command-clicking on a class name (or hitting F3).
    All my SWC are open source. BTW some of the source paths I was using were the path to the Flex code and to datavisualtization lib, which I think are the biggest library I am linking against. So maybe to recreate, just add those 2 libraries and make sure to add the source path AND source attachment.
    I am using RSLs for every library if that matters.
    I don't understand why specifying a Source Attachment would cause any issues...  the swc is in sync with the source specified in its source attachment.

  • Text edit area appears as inactive/text box is invisible - help?

    I'm having this strange issue with the Photoshop type tool in Photoshop CS5. It might be, although I'm not sure, a bug. The tool itself is working and lets me add text and edit it as I please. But the box that shows up when editing text (and the blinking line that shows where I am in the text) - has gone invisible. I am having this issue in only one document. - I tested the type tool on other documents, and everything was normal. I've looked up shotcuts and hotkeys to check if I've tapped a key or something, but it doesn't appear to be so.
    Now about the document; it does have quite the amount of text layers, and a lot of text in them.
    I've tried resetting the type tool, and I've restarted the program.
    When I restart the program, the tool works as it's supposed to - but after editing or adding a new text layer, the editing area is gone again! Is this a bug, or have I touched keys that do odd things?

    It's reasonable to suspect having done something odd, since there are SO many things that can affect what you see on the screen.
    However, if you're seeing different behavior at different times with doing the exact same things on the same layers then you may well have triggered some kind of bug.
    The stock advice is to check to ensure your display driver on your system is updated.  On PCs that involved visiting the web site of the maker of your video card and seeking their download for the driver to match your hardware and OS.  On Macs one has to ensure the system is fully up to date from Apple.
    -Noel

  • SQL Window Text Edits Not Working

    I've been using SQL Developer 1.5.1 for some time now and it has worked great. Just recently, I'm not able to do simple text edits in the SQL window. I run sql queries constantly and have had to go back to an older version of SQL Developer. I have no idea what I may have done to cause this.
    I can type in the sql window, but I cannot move my cursor to any part of the entered text. I cannot move to a new line [Enter key], or back space, or delete text. I can highlight text and delete it, but simple text edits do not work.
    Has anyone experienced this and if so, is there a known cause and/or fix?
    I have no idea on how to uninstall this version and reinstall it. I've tried deleting the files and re-running the zip, but my old settings are still present.
    Help?

    I had exactly the same problem and the Tools/Options/Accelerator/Load Preset fixed it. Thanks a lot!!!!
    Alex

  • How can I show only text edits and not text formatting when using print comments summary?

    Acrobat 9.3.0 for Mac.
    Here is the scenario: I used the Compare command to see the changes between 2 PDFs. The resulting file some edits are inserts and some are deletions. I want to print a comments summary only showing the text edits. In the Compare Option pane, I select Text and deselect Images, Annotations, Formatting, Headers/Footers, and Backgrounds. Now on the screen I see inserts are highlighted in blue and deletions are marked with sort of a caret and vertical bar symbol. So all looks good at this point. However, when I show the Comments List, I see addtional comments that indicate "Replace - The following text attributes were changed: fill color." Those comments do not appear in the page view unless I check the Formatting check box to show them. With Formatting unchecked, I print a comments summary and all of the "Replace - Fill Color" comments" appear on the resulting comments summary.
    I only want to show text edits, not text formatting changes. So questions are:
    1. Why, when the Formatting checkbox is unchecked, do the text formatting comments still appear in the comments list when they do not appear on the page display.
    2. How can I print only the text content edits and not show the text formatting changes when using Print Comments Summary.

    Hi,
    You can set ExecuteWithParams as default activity in the task flow then method activity to return total no of rows passing to Router activity if your method has value 0 then call Create insert operation else do directly to page.
    Following idea could be your task flow
    Execute With param (default) > SetCurrentRowWithKey > GetTotalNoOfRows (VOImpl Method)
    |
    v
    Router
    1. If pageFlowScope outcome is 0 then call CreateInsert > MyPage
    2. if pageFlowScope outcome > 0 then MyPage
    hope it helps,
    Zeeshan

Maybe you are looking for

  • SQL server 2014 and VS 2013 - BuilInsert task - truncate a field data of a CSV file and insert it to SQL table.

    Hello everyone, To move data from roughly 50 CSV files in a loop to SQL tables (table per CSV file), I've used BulkInsert task in For each loop container. Please know, for all different columns of all CSV files, the filed length was specified as varc

  • Idoc Mapping Problem

    hi, I have a file to idoc scenario. Have a header and 5 line items segment on the source. After doing mapping when i test, the message mapping does not ouput all the corresponding nodes in the Idoc structure for each item segment on the source side.

  • What is the latest version of ipod firmware?

    In 2009 it was version 1.3 (it's the only entry I found and it happens to be my version as well) Now being Dec 2013 I was wondering if there are any updates for such an old ipod video. Obviously if Itunes were installed it would tell me but it isn't

  • Wi-fi wont connect further than 10ft

    My ipad wont connect to wi-fi from further than 10ft. It used to work fine until a couple of months ago, but now you need to be next to the router

  • Java Linked List Help

    Hey, I am having trouble understanding the Linked List implementation code given under the Node Operations part of this pdf. http://www.cs.berkeley.edu/~jrs/61b/lec/07.pdf public ListNode(int item, ListNode next) { this.item = item; this.next = next;