Integrate a text editor in an ITS applicate

Hello,
I want to develop an ITS application for our sales reps to be able to key in text and also have the ability to change fonts, bold, underline, etc and then save this text to be displayed elsewhere.  I have seen many text editors on the internet, such as TinyMCE, etc. but have not had any luck getting them to work.  Has anyone been able to integrate a text editor in their ITS application?
Thanks.
Tim

Hi Tim,
did you try class CL_GUI_TEXTEDIT on your Dynpro and translate it into HTML-Template to get coding?
br,
ralph

Similar Messages

  • The text editor in release 2

    We have portal release 2 running on HP-UX.
    In release 2 there is a new text editor for publishing text. Its used for simple text and text item types.
    How is this feature implemented? Is the source code available?
    Feedback appreciated.

    Hi,
    It is called Rich Text editing. A search on google with the keywords rich text edit
    will give you links to quite a few sites, where the source is available. It uses
    a combination of DHTML and JavaScript.
    We have portal release 2 running on HP-UX.
    In release 2 there is a new text editor for publishing text. Its used for simple text and text item types.
    How is this feature implemented? Is the source code available?
    Feedback appreciated.

  • Text Editor using cl_gui_textedit

    Hi,
    I need a text editor box on selection screen in display mode. and I'm using cl_gui_textedit class to get it.. but for some reason its not working.
    Here is the code below -
    report YLTEST1
           no standard page heading line-size 255.
    DATA: g_text_editor             TYPE REF TO cl_gui_textedit,
          g_text_container          TYPE REF TO cl_gui_custom_container,
          g_gen_text_editor         TYPE REF TO cl_gui_textedit,
          g_gen_text_container      TYPE REF TO cl_gui_custom_container.
      DATA: WORDWRAP_POSITION LIKE CL_GUI_TEXTEDIT=>M_WORDWRAP_POSITION.
      data: g_gen_txt_container       TYPE scrfname VALUE  'GENERAL_TEXT_FOR_REPS'.
      DATA: TEXT_TAB      TYPE STANDARD TABLE OF LINE.
    parameters: p_check.
    at selection-screen output.
    Create sales Text container
      WORDWRAP_POSITION = 100.
      IF G_GEN_TEXT_CONTAINER IS INITIAL.
            CREATE OBJECT:
                 G_GEN_TEXT_CONTAINER EXPORTING CONTAINER_NAME = G_GEN_TXT_CONTAINER,
                 G_GEN_TEXT_EDITOR    EXPORTING PARENT = G_GEN_TEXT_CONTAINER
                 WORDWRAP_MODE =  CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
                 WORDWRAP_POSITION = WORDWRAP_POSITION
                 WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.
      ENDIF.
      IF not G_GEN_TEXT_CONTAINER IS INITIAL.
    Set container options
      CALL METHOD: G_GEN_TEXT_EDITOR->SET_TOOLBAR_MODE
                                  EXPORTING TOOLBAR_MODE   = 0,
                   G_GEN_TEXT_EDITOR->SET_READONLY_MODE
                                  EXPORTING READONLY_MODE  = 1,
                   G_GEN_TEXT_EDITOR->SET_STATUSBAR_MODE
                                  EXPORTING STATUSBAR_MODE = 0,
                   G_GEN_TEXT_EDITOR->SET_AUTOINDENT_MODE
                                  EXPORTING AUTO_INDENT    = 1.
    Pass the text to the sales text container
      CALL METHOD G_GEN_TEXT_EDITOR->SET_TEXT_AS_STREAM
        EXPORTING
          TEXT = TEXT_TAB.
      endif.

    Try this way:
    DATA: lo_dock TYPE REF TO cl_gui_docking_container.
    DATA: lo_text_editor TYPE REF TO cl_gui_textedit.
    DATA: lt_tab TYPE STANDARD TABLE OF char80.
    DATA: la_tab LIKE LINE OF lt_tab.
    DATA: w_carrid TYPE sflight-carrid.
    ** Selection Screen
    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
    SELECT-OPTIONS: s_carrid FOR w_carrid.
    SELECTION-SCREEN: END   OF BLOCK blk1.
    INITIALIZATION.
    * Docking container
      CHECK lo_dock IS INITIAL.
      CREATE OBJECT lo_dock
        EXPORTING
          repid     = sy-cprog
          dynnr     = sy-dynnr
          ratio     = 80
          side      = cl_gui_docking_container=>dock_at_bottom
          name      = 'DOCK_CONT'.
      IF sy-subrc <> 0.
        MESSAGE 'Error in the Docking control' TYPE 'S'.
      ENDIF.
    * Text Editor
      CREATE OBJECT lo_text_editor
        EXPORTING
          parent                 = lo_dock
        EXCEPTIONS
          error_cntl_create      = 1
          error_cntl_init        = 2
          error_cntl_link        = 3
          error_dp_create        = 4
          gui_type_not_supported = 5
          OTHERS                 = 6
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set text
      la_tab = 'This is test'.
      APPEND la_tab TO lt_tab.
      CALL METHOD lo_text_editor->set_text_as_r3table
        EXPORTING
          table           = lt_tab
        EXCEPTIONS
          error_dp        = 1
          error_dp_create = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Regards,
    Naimesh Patel

  • Using a different Rich Text Editor ?

    Hi,
    I'd like to know if you're using a different Rich Text Editor other than the one provided by Oracle ?
    Are you satisfied with it ? Especially in the management of images ?
    Thanks
    Max.

    there is a textflow component
    http://blog.flexexamples.com/2009/07/25/exporting-a-textflow-object-in-flex-4/
    still exports to font tags unfortunately, but its closer than the richtexteditor. Its basically at the point where you could even write your own small parser and adapt the output to the format you desire.

  • How to drag global data in text editor in smart forms

    Hello friends,
    I am doing a smartform. I tried to drag the global data from field list and drop it in text editor but its not working.
    can you please help me how to do that or is it need any extra settings?
    Please help me friends.
    Thanks,
    Manisha
    Edited by: PATIL MANISHA on Apr 23, 2010 12:14 PM

    Hi Manisha,
    It is looking very strange. But still try to do following may be helpfull.
    1. First activate your smart form after declaring the variable in Global definition. Then try to drag n drop from Field list
    2. Or else click on Editor tab of Text node, Then Goto-> change editor (You will get a editor same as Sapscripts)
    put the variable like that:
    HT : &W_TOTAL-MASSG&
    Try this. Best luck...
    Regrads,
    Lokesh.

  • Newbie help with sample Studio app. "Plain Text Editor"

    I'm trying to make the jump from AppleScript to AppleScript Studio, and because I want to eventually write a document producing application I thought I'd start with the textbook example "Plain Text Editor" included with Xcode. I think I see how menu items are connected to "Target/Actions," and I was able to build and run it without difficulty. It's remarkable how little AppleScript had to be written to produce a rudamentary text editor. But in playing with the built application, I noticed that the Revert menu item does not work exactly as expected.
    If you create a text document, and then make some change to it, and then click the Revert menu item, you get the expected little dialog asking if you want to revert to the most recently saved version, but if you then click the Revert button, the text displayed in the text view object does not revert to the original. However, something is happening, because whatever code is behind the Save, Close, and Quit menu items does seem to be "aware" that the Revert item has been invoked: because if you click one of these after Revert, the "do you want to save changes?" warning doesn't appear, just as one might expect.
    The Revert menu item seems to be connected to a "Target/Action" called "revertDocumentToSaved:" which sounds perfectly reasonable. But does the fact that Revert doesn't cause the displayed editing text to revert mean that (a) there is a bug in the code behind this Target/Action, or (b) that the writer of this textbook example just didn't bother to do everything needed for the Revert item to work in an intuitive manner?
    Whichever the answer, what would I do to make it work properely?
    It seems like there must be some sort of connection between the text view object in the editing window, and the Close, Save, Quit suite of menu items, because the behavior of these is dependant on whether or not there are unsaved changes in the text view object. But looking through the Inspector for this object, I don't see any, neither AppleScripts, nor Outlets, nor Target/Actions. Where and for what should I be looking?
    Dual 1.2 GHz   Mac OS X (10.4.8)  
    Dual 1.2 GHz   Mac OS X (10.4.8)  

    I think -- and I'm sure someone will correct me if I'm wrong -- that this is a place where AppleScript Studio's implementation just isn't done right. Either they intended to add a "revert" handler somewhere and forgot, or else they meant to have it send an existing message and didn't.
    I haven't done any document-based applications -- heck, I've only dabbled slightly in AppleScript Studio -- so there may be a "deeper" answer to this, but you might consider just hooking the menu item up to send its "choose menu item" handler to your document script, and have it react accordingly.

  • Portal Rich Text Editor in Firefox 3.5 Not Working

    I'm using Oracle Portal Version: 10.1.4.0.0 (Build: 594)
    The text item Rich Text editor works fine in IE 6 and has reduced functionality in Firefox 3.0 (scroll doesn't work). I've just updated to Firefox 3.5 and the text editor doesn't work at all now.
    The user is presented with a grey box where all the text controls are squashed into the top left hand corner.
    The following errors appear in the Error Console :
    Error: element.children.tags is not a function
    Source File: http://xyz.example.net:7778/images/webword/WebWordMenuToolbar.js
    Line: 1
    Error: attachEvt is not defined
    Source File: http://xyz.example.net:7778/images/webword/buildUI1.js
    Line: 76
    (I've replaced our server url with http://xyz.example.net)
    Has anyone else noticed this? Has anyone got any suggestions on what I can do to investigate/fix it?
    Thanks,
    Matt
    Update :
    There is a patch available to potentially fix the Rich Text Editor issues in Firefox
    "The Rich Text Editor Does Not Work Correctly In FireFox" - Metalink Doc ID: 456512.1
    or you can replace the RTE completely with a 3rd party editor :
    "How to integrate third party RTE (FCKeditor) with Oracle Portal" - Metalink Doc ID: 352796.1
    Using FCKEditor may well solve the issues but I only use Firefox for development. Our users use IE6 so I don't want to replace the interface unless I have to.
    Edited by: Matt Hawkins on Jul 15, 2009 1:58 PM

    This is a known issue in both Portal 10.1.4.x and Portal 11.x :
    Bug 8708210 (11) NOT ABLE TO RENDER RICH TEXT EDITOR WITH FIREFOX 3.5 BROWSER
    This bug is not published on Metalink.
    There is no solution yet. Consider to use IE Tab (https://addons.mozilla.org/en-US/firefox/addon/1419) for editing file items until this bug is solved.

  • ERROR_CNTL_CREATE while calling BDC from transaction MM02 for Text Editor

    Hi Friends,
    I am using transaction MM02 when creating Purchase Order Text . Its working fine in foreground, but when I run it in background it is raising exception  ERROR_CNTL_CREATE when calling the Text Editor.
    I know in background SAPGui is not available and thats why it is raising the exception. But is there a way I can avoid it?
    Thanks in advance,
    Victoria
    Here is the dump info:
    The termination occurred in the ABAP program
    "CL_GUI_TEXTEDIT===============CP" 
      In "CONSTRUCTOR".                                                                 
    The main program was "SAPMMG01 ".                                                  
        The termination occurred in line 6 of the source code of the (Include)             
    program "CL_GUI_TEXTEDIT===============CM002"                                    (when calling the editor 60).                                                           
        The program "CL_GUI_TEXTEDIT===============CP" was started as a background job.                                                                               
    Error occurred during batch input processing                                           
    Here is the source code where the error occurs:
        1 *creates and links TextEdit control                                                  
        2 METHOD constructor .                                                                 
        3   DATA prog_id(80).                                                                  
        4                                                                               
    5   if parent is initial.                                                              
    >>>>>     raise error_cntl_create.                                                         
        7   endif.                                                                               
    8                                                                               
    9   CLASS cl_gui_cfw DEFINITION LOAD.                                                  
       10                                                                               
    11 * assign prog_id to get the frontend specific control                                
       12   if not activex is initial.                                                         
       13     prog_id = 'SAPGUI.TextEditCtrl.1'.                                               
       14   elseif not javabean is initial.                                                    
       15     prog_id = 'com.sap.components.controls.textEdit.SapTextEdit'.              
      endif.

    Dear Vicki Reed,
    I encounter same raise exception ERROR_CNTL_CREATE in MM02 while maintaining material texts in different languages.
    Can you please let me know how you resolved this issue in your case.
    Thanks in advance .
    Warm Regards,
    RajaShekar Gangula.

  • Rich Text Editor with Custom Text Attribute

    Hello All,
    We are using the latest version of Oracle Portal 10G. I have a need to create custom Attributes of the type text to let people enter a lot of text. But when User are in edit mode of an item where this custom attribute is used, the Rich Text Editor is not shown for entering the Text for the Custom Text Attribute. It shows a normal html text area. Has anyone ever used RTE with Custom Attribute?
    I request you guys for help.
    Thanks.

    The Problem with the Custom Attribute is not solved, but I have now compromised with the Situation and now I am not using a Custom attribute.
    Rather, Now I am creating a Custom Item Type using Base Text Type (earlier i wanted to create custom item type at my own without any base item type). In this case now I will not be able to change the Lable of the RTE (that is "Text", when the Custom Item is in Edit Mode), but I hope that my users can understand that much.
    I have created a template for portal pages. In the Template I can edit the Region Properties. When I edit the Region property of the region where I want to display my Custom Items. I get two Tabs on the top, Main and Attributes/Style. ON the main tab I can tell what type of region it should be, width etc, in my case it is item type region. And on the Attributes/Style tab, I can select from the availabe Attributes as which all Attributes I want to display. Here if i select only "Associated Functions" Attribute then normally portal should not render anything by default on the Page. It should rather make a call to the procedure which is associated with the Custom Item and as when I was creating the custom item type, I had clicked on "Display Procedure Results With Item", so portal should now display the result of my Procedure. So far it works without problem.
    But the problem is that the Portal displays the text at its own also. As i have written that Portal should not display anything at its own, this doesn't work in this version of Portal for a Custom Item Type that is made using Base Text Item Type. For all others it has worked till now (I have create 50s of Custom item types).
    You can better understand by going to the following URL. Just have a look between the two dotted lines (Dotted line is also a seperate Custom Item Type). Between the two Dotted Lines is a custom item, in general it would be a Custom News Item having title, image and so on.
    http://sunnode1.edvz.sbg.ac.at:7778/portal/page?_pageid=79,56047&_dad=portal&_schema=PORTAL
    I have really programmed a lot with portal but now at this stage where I am near to end, I am getting problems which are coming from Product. I request you for help.

  • Rich Text editor in Webdynpro

    Hi,
    With the new FormattedTextView in 2004s one will be able to render xhtml compliant rich test in Webdynpro.
    This however only covers the rednering of rich text.
    There still does not seem to be a rich text editor control available for webdynpro applications, which I think might be a common requirement for document centric applications.
    I was wondering :
    1 - will there be a richt text editor control available for WDP in the forseeable future ?
    2 - if not, are there any workardounds available to allow for the generation of rich text ?

    Hi Valery,
    Well, I already thought of that kind of solution, but I do not consider it a very clean solution. I know WDP supports portal eventing. On the other side of such a scenario you could even do without a 3rd party wysiwyg editor, cause SAP does offer an html editor control in its set of HTMLB controls.
    We intend to use WDP as a UI layer on top of SAPs KM. Our scenario involves template based publishing of structured documents (we first looked at xml forms, but they showed too many limitations). The idea is to model the document structure and content at runtime as WDP context structures (based on xml schemas) and then to serialize WDP context into XML content and metadata, with KM acting as business and persistence layer. Markup and insertion of images into the different text parts of the document however has become an additional requirement, which is why we are looking for a ways to fit that in our current design.
    You could indeed think of some kind of data exchange between a regular portal component and the wdp application, but I am not too confident whether that is going to be a reliable solution.
    PS : for the serialization of WDP context, your post in a different thread on this forum helped me a lot in my first attempts to create KM documents from data wdp runtime data (context). The link provided to the online book and your little example was very welcome. Thanks for that !

  • Rich text editor problem

    Hi,
    I'm using stellent 7.5.1.
    I cannot upload pics and/or update text via the rich text editor .. The editor field opens, but just stays grey, i.e. they don’t have any option of entering or saving text.
    I have even checked Java version its fine.
    Do i need to change any config setting to enable to editor again?
    Thanks

    The 7.5 editor uses an ActiveX plugin, so it only works in Internet Explorer. There may also be security settings in Internet Explorer that might interfere with the way it works.
    If you get it going, try this article for some enhancements to the editor.
    http://webmonkeymagic.blogspot.com/2007/12/get-enhanced-contributor-editing.html

  • Rich Text Editor not showing up

    Hi. I've installed OracleAS 10g Rel 2.
    When I try to add text using IE6 the text area is just gray. I have tried to change different attributes in IE but its still gray. I dont know how to debug IE either, I normally use firefox.
    Any ideas how I can debug IE, or what I should change on my IE to make the rich text editor show up.
    (btw, the installation is on my laptop, using XP pro. Not supportet but generally works fine. I know ppl at Oracle have this working on XP so it should not be the issue).

    hi terje,
    i just tested this on my 10.1.2 installation using IE6 and it works fine. so it seems not to be any general issue.
    2 things i would check:
    - does a java scrip error occur on the page when you add/edit a text item. you see this in the left lower corner of the browser.
    - check the log files on the application server mid-tier.
    - but before starting debugging i would go to another pc and try to access your portal from there. this will show you if your client machine is the problem or if the portal installation is the problem.
    regards,
    christian

  • Format XMl to be read in a text editor.

    Hi,
    I'm using ixml functions to create an xml file. Each element of my document is created using :
    <cl_xml_document> ->create_simple_element
    I then export it to a file with :
    <cl_xml_document>->export_to_file
    When the created file is opened with an xml viewer, it appears well presented, every tag is displayed on a seperate line.
    However, once opened with a text editor, the whole content is displayed on one line. Is there to format the file with some sort of line seperator?
    On debugging, I found out that only one line of its internal table is used to store the data.

    Welcome to SDN
    Try this,
    data: temp_str type string.
    concatenate '>' cl_abap_char_utilities=>cr_lf '<' into temp_str .
    replace all occurrences of '><' in XML_STRING with temp_str.
    xml_string is the straing variable to hold the xml .
    now use xml_string to show it in texteditor.
    Regards
    RAja

  • Java Text Editor

    I have created an applet editor that will enable a user to break a text file down into a series of smaller html files. This does serve a purpose that is not really important at the moment and I don't want to bore you all.
    The problem I am having is that upon clicking the open button and the 2 save buttons, the applet opens file chooser where you can select a file. The problem is that once the file is open, the applet, for some reason starts the openfile() method again. The same happens when using the the 2 saveFile() methods. Can anyone help?
    package tagger;
    import java.awt.*;
    import java.applet.*;
    import javax.swing.JComboBox;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.text.Document;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JScrollPane;
    import javax.swing.SwingConstants;
    import javax.swing.JLabel;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    import java.net.URL;
    import java.io.IOException;
    import java.io.DataInputStream;
    import javax.swing.filechooser.FileFilter;
    * <p>Title: Cheshire Parish Register Database Note Tagging System</p>
    * <p>Description: An online Text Editor and Note Creation Tool for use with
    * CPRDB</p>
    * <p>Copyright: </p>
    * <p>Company: The University Of Liverpool</p>
    * @author Mike Melling
    * @version 1.0
    public class NoteTagger extends Applet {
        public String fileName = null;
        boolean isStandalone = false;
        BorderLayout borderLayout1 = new BorderLayout();
        JPanel jPanel1 = new JPanel();
        BorderLayout borderLayout2 = new BorderLayout();
        JPanel jPanel2 = new JPanel();
        JPanel jPanel3 = new JPanel();
        JPanel jPanel4 = new JPanel();
        JPanel jPanel5 = new JPanel();
        JPanel jPanel6 = new JPanel();
        BorderLayout borderLayout3 = new BorderLayout();
        BorderLayout borderLayout4 = new BorderLayout();
        BorderLayout borderLayout6 = new BorderLayout();
        BorderLayout borderLayout7 = new BorderLayout();
        JScrollPane jScrollPane1 = new JScrollPane();
        JTextArea jTextArea1 = new JTextArea();
        JScrollPane jScrollPane2 = new JScrollPane();
        JTextArea jTextArea4 = new JTextArea();
        BorderLayout borderLayout8 = new BorderLayout();
        JPanel jPanel7 = new JPanel();
        JPanel jPanel8 = new JPanel();
        JPanel jPanel9 = new JPanel();
        JPanel jPanel10 = new JPanel();
        JPanel jPanel11 = new JPanel();
        JPanel jPanel13 = new JPanel();
        JPanel jPanel14 = new JPanel();
        BorderLayout borderLayout9 = new BorderLayout();
        JPanel jPanel15 = new JPanel();
        JPanel jPanel16 = new JPanel();
        JPanel jPanel17 = new JPanel();
        JPanel jPanel18 = new JPanel();
        JPanel jPanel19 = new JPanel();
        BorderLayout borderLayout10 = new BorderLayout();
        JButton jButton2 = new JButton();
        JButton jButton1 = new JButton();
        JPanel jPanel22 = new JPanel();
        BorderLayout borderLayout12 = new BorderLayout();
        JScrollPane jScrollPane5 = new JScrollPane();
        JTextArea jTextArea3 = new JTextArea();
        JLabel jLabel1 = new JLabel();
        BorderLayout borderLayout13 = new BorderLayout();
        BorderLayout borderLayout14 = new BorderLayout();
        FlowLayout flowLayout1 = new FlowLayout();
        BorderLayout borderLayout15 = new BorderLayout();
        JPanel jPanel27 = new JPanel();
        Document document1 = jTextArea1.getDocument();
        Document document2 = jTextArea3.getDocument();
        JFileChooser jFileChooser1 = new JFileChooser();
        String currFileName = null; // Full path and filename. null means new/untitled.
        JPanel jPanel20 = new JPanel();
        java.awt.BorderLayout borderLayout16 = new BorderLayout();
        JPanel jPanel24 = new JPanel();
        JTextField jTextField1 = new JTextField();
        JPanel jPanel25 = new JPanel();
        java.awt.BorderLayout borderLayout18 = new BorderLayout();
        JTextField jTextField2 = new JTextField();
        JPanel jPanel26 = new JPanel();
        JPanel jPanel12 = new JPanel();
        JPanel jPanel21 = new JPanel();
        JPanel jPanel23 = new JPanel();
        JPanel jPanel28 = new JPanel();
        java.awt.BorderLayout borderLayout5 = new BorderLayout();
        JButton jButton6 = new JButton();
        JButton jButton7 = new JButton();
        JFileChooser jFileChooser2 = new JFileChooser();
        String currFileName2 = null; //Full path and filename. null means new/untitled
        JButton jButton3 = new JButton();
        public String getParameter(String key, String def) {
            return isStandalone ? System.getProperty(key, def) :
                    (getParameter(key) != null ? getParameter(key) : def);
        //Construct the applet
        public NoteTagger() {
            try {
                jbInit();
            } catch (Exception ex) {
                ex.printStackTrace();
        //Initialize the applet
        public void init() {
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
        //Component initialization
        private void jbInit() throws Exception {
            jPanel1.setLayout(borderLayout2);
            jPanel5.setLayout(borderLayout3);
            jPanel2.setLayout(borderLayout13);
            jPanel6.setLayout(borderLayout14);
            jPanel3.setLayout(borderLayout6);
            jPanel4.setLayout(borderLayout7);
            jTextArea1.setLineWrap(true);
            jPanel3.setPreferredSize(new Dimension(700, 100));
            jPanel4.setBackground(Color.lightGray);
            jPanel4.setPreferredSize(new Dimension(700, 50));
            jTextArea4.setPreferredSize(new Dimension(700, 100));
            jTextArea4.setEditable(false);
            jTextArea4.setText("");
            jScrollPane2.setVerticalScrollBarPolicy(JScrollPane.
                                                    VERTICAL_SCROLLBAR_ALWAYS);
            jScrollPane2.setPreferredSize(new Dimension(700, 100));
            this.setLayout(borderLayout8);
            jPanel2.setBackground(Color.lightGray);
            jPanel2.setPreferredSize(new Dimension(700, 850));
            jPanel7.setBackground(Color.lightGray);
            jPanel8.setBackground(Color.lightGray);
            jPanel9.setBackground(Color.lightGray);
            jPanel10.setBackground(Color.lightGray);
            jPanel11.setBackground(Color.lightGray);
            jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.
                                                    VERTICAL_SCROLLBAR_ALWAYS);
            jScrollPane1.setMinimumSize(new Dimension(300, 470));
            jScrollPane1.setPreferredSize(new Dimension(470, 470));
            jPanel13.setBackground(Color.lightGray);
            jPanel14.setBackground(Color.lightGray);
            jPanel14.setLayout(borderLayout9);
            jPanel15.setBackground(Color.lightGray);
            jPanel15.setLayout(borderLayout10);
            jPanel16.setBackground(Color.lightGray);
            jPanel16.setPreferredSize(new Dimension(10, 7));
            jPanel19.setBackground(Color.lightGray);
            jPanel18.setBackground(Color.lightGray);
            jPanel18.setPreferredSize(new Dimension(280, 33));
            jPanel18.setLayout(flowLayout1);
            jPanel17.setBackground(Color.lightGray);
            jButton2.setBackground(Color.lightGray);
            jButton2.setPreferredSize(new Dimension(83, 23));
            jButton2.setHorizontalAlignment(SwingConstants.CENTER);
            jButton2.setHorizontalTextPosition(SwingConstants.CENTER);
            jButton2.setText("Open");
            jButton2.addActionListener(new NoteTagger_jButton2_actionAdapter(this));
            jPanel5.setPreferredSize(new Dimension(500, 560));
            jPanel6.setBackground(Color.lightGray);
            jPanel6.setMinimumSize(new Dimension(217, 550));
            jPanel6.setPreferredSize(new Dimension(500, 560));
            jPanel22.setBackground(Color.lightGray);
            jPanel22.setLayout(borderLayout15);
            jScrollPane5.setHorizontalScrollBarPolicy(JScrollPane.
                                                      HORIZONTAL_SCROLLBAR_AS_NEEDED);
            jScrollPane5.setVerticalScrollBarPolicy(JScrollPane.
                                                    VERTICAL_SCROLLBAR_ALWAYS);
            jScrollPane5.setMaximumSize(new Dimension(32767, 245));
            jScrollPane5.setMinimumSize(new Dimension(300, 470));
            jScrollPane5.setPreferredSize(new Dimension(300, 470));
            jLabel1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 20));
            jLabel1.setToolTipText("");
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
            jLabel1.setText("Cheshire Parish Register Database Note Tagging System");
            jPanel27.setBackground(Color.lightGray);
            jTextArea3.setMaximumSize(new Dimension(2147483647, 2147483647));
            jTextArea1.setDocument(document1);
            jTextArea3.setMaximumSize(new Dimension(2147483647, 2147483647));
            jTextArea3.setDocument(document2);
            jButton1.setBackground(Color.lightGray);
            jButton1.setPreferredSize(new Dimension(83, 23));
            jButton1.setHorizontalAlignment(SwingConstants.CENTER);
            jButton1.setHorizontalTextPosition(SwingConstants.CENTER);
            jButton1.setText("Save");
            jButton1.addActionListener(new NoteTagger_jButton1_actionAdapter(this));
            jButton1.setEnabled(false);
            this.setBackground(Color.lightGray);
            jPanel1.setBorder(BorderFactory.createRaisedBevelBorder());
            jPanel1.setPreferredSize(new Dimension(1000, 750));
            jPanel20.setLayout(borderLayout16);
            jTextField1.setPreferredSize(new Dimension(62, 25));
            jTextField1.setText("");
            jPanel24.setBackground(Color.lightGray);
            jPanel24.setMaximumSize(new Dimension(10, 10));
            jPanel25.setLayout(borderLayout18);
            jTextField2.setMaximumSize(new Dimension(62, 25));
            jTextField2.setPreferredSize(new Dimension(62, 25));
            jTextField2.setText("");
            jPanel26.setBackground(Color.lightGray);
            jPanel26.setMaximumSize(new Dimension(10, 10));
            jPanel25.setPreferredSize(new Dimension(470, 505));
            jPanel12.setPreferredSize(new Dimension(300, 40));
            jPanel12.setLayout(borderLayout5);
            jPanel28.setBackground(Color.lightGray);
            jPanel21.setBackground(Color.lightGray);
            jPanel23.setBackground(Color.lightGray);
            jButton6.setBackground(Color.lightGray);
            jButton6.setPreferredSize(new Dimension(83, 23));
            jButton6.setText("Save");
            jButton6.setEnabled(false);
            jButton6.addActionListener(new NoteTagger_jButton6_actionAdapter(this));
            jButton7.setBackground(Color.lightGray);
            jButton7.setPreferredSize(new Dimension(83, 23));
            jButton7.setText("Query");
            jButton7.addActionListener(new NoteTagger_jButton7_actionAdapter(this));
            jFileChooser1.addChoosableFileFilter( new FileFilter1() );
            jFileChooser1.setAcceptAllFileFilterUsed( false );
            jFileChooser1.setMultiSelectionEnabled( false );
            jFileChooser1.setSelectedFile( null );
            jFileChooser2.addChoosableFileFilter( new FileFilter2() );
            jFileChooser2.setAcceptAllFileFilterUsed( false );
            jFileChooser2.setMultiSelectionEnabled( false );
            jFileChooser2.setSelectedFile( null );
            jButton3.setMaximumSize(new Dimension(83, 23));
            jButton3.setMinimumSize(new Dimension(83, 23));
            jButton3.setPreferredSize(new Dimension(83, 23));
            jButton3.setText("New");
            jButton3.addActionListener(new NoteTagger_jButton3_actionAdapter(this));
            jPanel1.add(jPanel2, java.awt.BorderLayout.CENTER);
            jPanel1.add(jPanel3, java.awt.BorderLayout.SOUTH);
            jScrollPane2.getViewport().add(jTextArea4);
            this.add(jPanel1, java.awt.BorderLayout.CENTER);
            jPanel3.add(jScrollPane2, java.awt.BorderLayout.CENTER);
            jPanel3.add(jPanel8, java.awt.BorderLayout.SOUTH);
            jPanel3.add(jPanel9, java.awt.BorderLayout.WEST);
            jPanel3.add(jPanel10, java.awt.BorderLayout.EAST);
            jPanel3.add(jPanel11, java.awt.BorderLayout.NORTH);
            jPanel5.add(jPanel7, java.awt.BorderLayout.WEST);
            jPanel5.add(jPanel13, java.awt.BorderLayout.EAST);
            jPanel5.add(jPanel20, java.awt.BorderLayout.CENTER);
            jPanel14.add(jPanel16, java.awt.BorderLayout.SOUTH);
            jPanel14.add(jPanel15, java.awt.BorderLayout.NORTH);
            jPanel15.add(jPanel19, java.awt.BorderLayout.WEST);
            jPanel15.add(jPanel17, java.awt.BorderLayout.EAST);
            jPanel15.add(jPanel18, java.awt.BorderLayout.CENTER);
            jPanel4.add(jLabel1, java.awt.BorderLayout.CENTER);
            jPanel18.add(jButton2);
            jPanel18.add(jButton1);
            jPanel20.add(jTextField1, java.awt.BorderLayout.NORTH);
            jPanel5.add(jPanel14, java.awt.BorderLayout.NORTH);
            jScrollPane1.getViewport().add(jTextArea1);
            jPanel25.add(jScrollPane5, java.awt.BorderLayout.SOUTH);
            jPanel25.add(jTextField2, java.awt.BorderLayout.NORTH);
            jPanel25.add(jPanel26, java.awt.BorderLayout.CENTER);
            jPanel6.add(jPanel12, java.awt.BorderLayout.NORTH);
            jScrollPane5.getViewport().add(jTextArea3);
            jPanel6.add(jPanel27, java.awt.BorderLayout.EAST);
            jPanel1.add(jPanel4, java.awt.BorderLayout.NORTH);
            jPanel1.add(jPanel5, java.awt.BorderLayout.WEST);
            jPanel1.add(jPanel6, java.awt.BorderLayout.EAST);
            jPanel6.add(jPanel22, java.awt.BorderLayout.WEST);
            jPanel6.add(jPanel25, java.awt.BorderLayout.CENTER);
            jPanel12.add(jPanel28, java.awt.BorderLayout.WEST);
            jPanel21.add(jButton7);
            jPanel21.add(jButton6);
            jPanel21.add(jButton3);
            jPanel12.add(jPanel23, java.awt.BorderLayout.EAST);
            jPanel12.add(jPanel21, null);
            jPanel20.add(jPanel24, java.awt.BorderLayout.CENTER);
            jPanel20.add(jScrollPane1, java.awt.BorderLayout.SOUTH);
        //Start the applet
        public void start() {
        //Stop the applet
        public void stop() {
        //Destroy the applet
        public void destroy() {
        //Get Applet information
        public String getAppletInfo() {
            return "Applet Information";
        //Get parameter info
        public String[][] getParameterInfo() {
            return null;
        // Open named file; read text from file into jTextArea1; report to statusBar.
         void openFile(String fileName) {
             try {
                 // Open a file of the given name.
                 File file = new File(fileName);
                 // Get the size of the opened file.
                 int size = (int) file.length();
                 // Set to zero a counter for counting the number of
                 // characters that have been read from the file.
                 int chars_read = 0;
                 // Create an input reader based on the file, so we can read its data.
                 // FileReader handles international character encoding conversions.
                 FileReader in = new FileReader(file);
                 // Create a character array of the size of the file,
                 // to use as a data buffer, into which we will read
                 // the text data.
                 char[] data = new char[size];
                 // Read all available characters into the buffer.
                 while (in.ready()) {
                     // Increment the count for each character read,
                     // and accumulate them in the data buffer.
                     chars_read += in.read(data, chars_read, size - chars_read);
                 in.close();
                 // Create a temporary string containing the data,
                 // and set the string into the JTextArea.
                 jTextArea1.setText(new String(data, 0, chars_read));
                 // Cache the currently opened filename for use at save time...
                 this.currFileName = fileName;
                 jButton1.setEnabled(true);
            jTextArea4.append('\n'+"Opnened "+ currFileName);
      catch (IOException e) {
        jTextArea4.append('\n'+"Error opening "+fileName);
        // Save current file; handle not yet having a filename; report to statusBar.
    boolean saveFile() {
        // Handle the case where we don't have a file name yet.
        if (currFileName == null) {
            return saveAsFile();
        try {
        // Open a file of the current name.
        File file = new File (currFileName);
        // Create an output writer that will write to that file.
        // FileWriter handles international characters encoding conversions.
        FileWriter out = new FileWriter(file);
        String text = jTextArea1.getText();
        out.write(text);
        out.close();
        jButton1.setEnabled(false);
                return true;
      catch (IOException e) {
        jTextArea4.append('\n'+"Error saving "+ currFileName);
      return false;
        // Save current file; handle not yet having a filename; report to statusBar.
        boolean saveFile2() {
            // Handle the case where we don't have a file name yet.
        if (currFileName2 == null) {
            return saveAsFile2();
        try {
        // Open a file of the current name.
        File file = new File (currFileName2);
        // Create an output writer that will write to that file.
        // FileWriter handles international characters encoding conversions.
        FileWriter out = new FileWriter(file);
        String text = jTextArea3.getText();
        out.write(text);
        out.close();
        jButton7.setEnabled(false);
                return true;
      catch (IOException e) {
        jTextArea4.append('\n'+"Error saving "+ currFileName2);
      return false;
        // Save current file, asking user for new destination name.
    // Report to statusBar.
        boolean saveAsFile() {
          // Use the SAVE version of the dialog, test return for Approve/Cancel
          if (JFileChooser.APPROVE_OPTION == jFileChooser1.showSaveDialog(this)) {
            // Set the current file name to the user's selection,
            // then do a regular saveFile
            currFileName = jFileChooser1.getSelectedFile().getPath();
            //repaints menu after item is selected
            this.repaint();
            return saveFile();
          else {
            this.repaint();
            return false;
        // Save current file, asking user for new destination name.
    // Report to statusBar.
        boolean saveAsFile2() {
          // Use the SAVE version of the dialog, test return for Approve/Cancel
          if (JFileChooser.APPROVE_OPTION == jFileChooser2.showSaveDialog(this)) {
            // Set the current file name to the user's selection,
            // then do a regular saveFile
            currFileName2 = jFileChooser2.getSelectedFile().getPath();
            //repaints menu after item is selected
            this.repaint();
            return saveFile();
          else {
            this.repaint();
            return false;
        public void jButton1_actionPerformed(ActionEvent e) {
            saveFile();
            // Display the name of the saved directory+file in the statusBar.
            jTextArea4.append('\n'+"Saved to " + currFileName);
        public void jButton7_actionPerformed(ActionEvent e) {
            try{
                getAppletContext().showDocument(new URL("http://www.csc.liv.ac.uk/~cprdb/Live/v3.3/database.html"), "_blank" );
            catch (MalformedURLException ex)
                ex.printStackTrace();
            jButton6.setEnabled(true);
        public void jButton6_actionPerformed(ActionEvent e) {
            saveFile2();
            // Display the name of the saved directory+file in the statusBar.
            jTextArea4.append('\n'+"Saved to " + currFileName2);
        public void jButton3_actionPerformed(ActionEvent e) {
         // Handle the File|New menu item.
         // Clears the text of the text area.
         jTextArea3.setText("");
         currFileName2 = null;
         jButton6.setEnabled(true);
         jButton7.setEnabled(false);
        public void jButton2_actionPerformed(ActionEvent e) {
                // Use the OPEN version of the dialog, test return for Approve/Cancel
            if (JFileChooser.APPROVE_OPTION == jFileChooser1.showOpenDialog(this)) {
        // Call openFile to attempt to load the text from file into TextArea
                openFile(jFileChooser1.getSelectedFile().getPath());
                  this.repaint();
    class NoteTagger_jButton3_actionAdapter implements ActionListener {
        private NoteTagger adaptee;
        NoteTagger_jButton3_actionAdapter(NoteTagger adaptee) {
            this.adaptee = adaptee;
        public void actionPerformed(ActionEvent e) {
            adaptee.jButton3_actionPerformed(e);
    class NoteTagger_jButton6_actionAdapter implements ActionListener {
            private NoteTagger adaptee;
            NoteTagger_jButton6_actionAdapter(NoteTagger adaptee) {
                this.adaptee = adaptee;
            public void actionPerformed(ActionEvent e) {
                adaptee.jButton6_actionPerformed(e);
        class NoteTagger_jButton7_actionAdapter implements ActionListener {
            private NoteTagger adaptee;
            NoteTagger_jButton7_actionAdapter(NoteTagger adaptee) {
                this.adaptee = adaptee;
            public void actionPerformed(ActionEvent e) {
                adaptee.jButton7_actionPerformed(e);
    class NoteTagger_jButton2_actionAdapter implements ActionListener {
        private NoteTagger adaptee;
        NoteTagger_jButton2_actionAdapter(NoteTagger adaptee) {
            this.adaptee = adaptee;
        public void actionPerformed(ActionEvent e) {
            adaptee.jButton2_actionPerformed(e);
    class NoteTagger_jButton1_actionAdapter implements ActionListener {
        private NoteTagger adaptee;
        NoteTagger_jButton1_actionAdapter(NoteTagger adaptee) {
            this.adaptee = adaptee;
        public void actionPerformed(ActionEvent e) {
            adaptee.jButton1_actionPerformed(e);
    class FileSelectorUtils {
              public static String getExtension( File file ) {
              return getExtension( file.getName() );
                    private static String getExtension( String str ) {
              String ext = null;
              int i = str.lastIndexOf( '.' );
                  if( i > 0 && i < str.length() - 1) {
                     ext = str.substring( i + 1 ).toLowerCase();
              return ext;
              public static File ensureExtension( File file, String ext ) {
                  if( getExtension( file ) == null ) {
                      file = new File( file.getAbsolutePath() + "." + ext );
                  return file;
          class FileFilter1 extends FileFilter {
             // Valid File Extension
             public final static String txt = "txt";
                  public boolean accept( File f ) {
             // Display Directory
             if( f.isDirectory() ) { return true; }
             // Get File's Extension
             String extension = FileSelectorUtils.getExtension( f );
             // Accept Select File Extensions
             if( extension != null ) {
    if( extension.equals( FileFilter1.txt ) ) { return true; } // Accept *.ann
            // Else Deny File
            return false;
            public String getDescription() {
            return "Text Doument (*.txt)";
            class FileFilter2 extends FileFilter {
             // Valid File Extension
             public final static String html = "html";
                  public boolean accept( File f ) {
             // Display Directory
             if( f.isDirectory() ) { return true; }
             // Get File's Extension
             String extension = FileSelectorUtils.getExtension( f );
             // Accept Select File Extensions
             if( extension != null ) {
    if( extension.equals( FileFilter2.html ) ) { return true; } // Accept *.ann
            // Else Deny File
            return false;
            public String getDescription() {
            return "HTML Document (*.html)";
            }Any ideas? I could do with help ASAP if anybody has any ideas... Thanks
    Mike

    The apps listed at java-tips.org are just some of those that happen to be written in Java. If you want an editor that does syntax highlighting and other programming-specific tasks, you have dozens more options. A few Windows editors that spring to mind are EditPad, Crimson Editor, Scite, UltraEdit and Notetab. Then there are the old Unix standys, Emacs and vi, which have Windows versions as well. I use EditPad Pro, which isn't free like many of the others, but is worth the money anyway, IMO.

  • Efficient data structure to implement simple text editor?

    I was given this problem in an interview:
    What data structure would you use to implement a simple text editor that does these 4 functions:
    a) goto(line number)
    b) insert(char input,location)
    c) delete(location)
    d) printAll() //print entire file
    Given that i'm such a newb, i was stumped. I came up with making a 2d array that would allow for o(1) time for goto, but o(n) for everything else (shifting everything in the array). there were other downfalls too dealing with space issues and such, but he wanted me to optimize this data structure. I then came up with a linked list of arrays, but that had similar problems.
    But thinking about it further is driving me a little crazy so I'm wondering if you guys have any suggestions on how to answer this question...
    one thing that came to mind after is to implement the data structure as a binary tree, where each node contains
    class Node
    char theChar
    int position; // ie 0 = first character in the file, and 81 could be the first character in the 2nd line
    node left,right,parent;
    }so how it works is the cursor would know where the location was so i would know where to delete and insert within the tree.
    insert {
         //search for location to insert after (log n)
           //create new character node and append to current node
         //increment position for all subsequent children
    delete(x) {
         search for x position
         if found, remove node and decrement position value for all children
    goto(line #) {
         return line # * 80 (or whatever max length for a single line)
    }the major problem i see here is balancing the tree after every insert/delete
    Thanks in advance.

    One of many great things emacs has given us is the gap buffer:
    http://en.wikipedia.org/wiki/Gap_buffer
    To see a Java implementation of this you can look in the Java SDK source. The document model (I forget exactly what its called), used in Swing uses a gap buffer.

Maybe you are looking for

  • Ensemble with L8

    Good evening all.. My current setup is a MIC into SSL alpha channel then from the SSL to the Ensemble channel 1 in. I am finding I'm getting a better quality with the MIC is connected directly to the Ensemble, so my question is: Is there a way to dis

  • TC starts to restore then stops - Pls Help!

    The hard drive in my early '08 MBP died the other day, so I switched it out for a new one.  After hooking up the new HD I put in the install disc, ran disc utility, erased the drive, which set up a partition, and restarted.  I then picked a language

  • Recently Upgraded to Mac 10.6.6. and I lost my CD extensions

    I recently upgraded my Mac OS to 10.6.6 and lost my CD extensions. No music CDs, no DVDs, not even the Snow Leopard cd wil mount now. Any ideas where I can download the CD extensions?

  • IDOC to File (BYpass)-- Error or Warning  :  " Message Branched. "

    HI all, Iam trying idoc to file scenario(bypass) my idoc is triggered succesfully and it is reaching to the receiver system. but the problem is in SXMB_MONI ,it is not showing my Receiver service details and showing with different symbol like " <b>>>

  • HELP! PLEASE READ THIS!

    Hi, Before posting your question in this forum, please make sure that you: 1.looked at the Portal FAQ: http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm 2. searched through the archive Chances are that most of the questions were answered b