Smart-tabbing help

i am trying to implement a smart tabbing feature: when the user hits enter the smartTab function is called. textPane is a JTextPane.
       private void smartTab() {
            System.out.println("smartTab()");
                    //finds the last line
                      int carPos = textPane.getCaretPosition();
                      String str = textPane.getText().substring(0,carPos);
                      StringTokenizer st = new StringTokenizer(str,"\n");
                      String line = null;
                      for(int i=0; i<st.countTokens(); i++) {
                           if(!st.hasMoreElements()) break;
                           if(i==st.countTokens()-1) {
                                line = st.nextToken();
                                break;
                           } else {
                                st.nextToken();
                      int tabs = 0;
                      if(line==null) return;
                      for(int i=0; i<line.length(); i++) {
                           if(line.charAt(i)!='\t') break;
                           else tabs=i+1;
                      System.out.println("tabs calculated: "+tabs);
                      if(tabs==0) return;
                      String t = "";
                      for(int i=1; i<tabs; i++)
                           t = t+"\t";
                           try {
                                textPane.getDocument().insertString(carPos,t,null);
                           } catch(Exception e) {  }
                      System.out.println("tabs set");
            return;
       }sometimes it works, sometimes it doesn't.
Any help is greatly appreciated.
TravenE

I overrode the insertString(..) method of a Document to insert a matching brace "}" when a starting brace "{" is entered. Check out the code here if your interested:
www.discoverteenergy.com/files/SyntaxDocument.java
The concept for the "\n" character would be the same. Don't worry about the size of the class, most of the code is for syntax highlighting, the code you are interested in is only 10-15 lines.

Similar Messages

  • Tabs only open in a new window. Ctl T opens a new window NOT a new tab help-last update this problem started. How do I set FF back to open tabs in 1 window

    Tabs only open in a new window. Ctl T opens a new window NOT a new tab help-last update this problem started 2 days ago. How do I set FF back to open tabs in 1 window?
    There is no plus sign and going into optins and changing settings has not worked. I have uninstall FF and reinstall-keeping my personalization-and that was no help.
    Right clicking on FF Icon to open a new tab, or going up to FF drop down tab and clicking on new tab both do not work.
    Help everything opens a new window not a new tab. there seems to be no way to reset this or to chose a different optin. I just downloaded new tabs at end addon and it didn't do a thing.

    as a first troubleshooting step - does it work like normally when you open & run firefox in [[Safe Mode|safemode]] by pressing the shift key while you open firefox (all other instances have to be closed before)...

  • Issue with Smart View Help Contents using v11.1.2.0.01

    Hi there,
    I just installed v11.1.2.0.01 (Build 003) of the Smart View add-in on a MS Windows XP SP2 PC with MS Office 2003 SP3.
    Unfortunately, the Help Contents in MS Excel does not seem to work as whenever I select Smart View > Help > Contents, nothing gets displayed. Selecting Smart View > Help > Technical Support and Smart View > Help > EPM Documentation takes me to various links on the www.oracle.com site.
    I uninstalled then re-installed this specific version a few times but to no avail. I even checked the contents of each subdirectory where Smart View has been installed but could not find any Help files whatsoever.
    1. Has anyone ever encountered this issue?
    2. If yes, what do I need to do to resolve this issue and get the Smart View Help to be displayed?
    Thanks in advance,
    JBM

    Well, reading the documentation about knowing where to find the documentation would have actually helped. At the bottom of page 10 of the Smart View ReadMe document, the following is mentioned under the "Documentation Updates" section:
    "For Smart View online help to be available, the Shared Connections URL on the Advanced page of the Options dialog box must contain an EPM Workspace URL."
    This question is now answered.
    JBM

  • Smart value help autocomplete doesn't work

    Hello,
    We are using CRM 7.0. We want to provide an autocomplete option for some customer input field.
    We decided to implement it with smart value help (F4) functionality. This customer field belongs to the customer Z view.
    When we use this Z view in the Z component, autocomplete wotks fine but when we use it in the standard component, F4 popup help works but autocomplete (smart value help) doesn't work.
    We would appreciate any help on this issue.
    Thanks in advance,
    Sergey

    Your .zshrc is only read when you start a new shell: https://wiki.archlinux.org/index.php/Zs … tion_files

  • I have Ver.31 on 2 computers but I only have a Super Smart tab page on 1. How do I get it back on my other laptop?

    I had a Super Smart tab on both of my laptops. When I updated to Version 31 one of my laptops lost the Super Smart tab feature. It has a "tab" feature where I can pin links but it just doesn't look as nice as the Super Smart tab does.

    It in all probability had a problem with compatibility. You can re-install it using
    https://addons.mozilla.org/en-US/firefox/addon/super-start/
    or if you use V3.6 then
    https://addons.mozilla.org/firefox/downloads/file/193648/super_start-3.6.4b-fx.xpi?src=dp-btn-devchannel
    hope it helps

  • Smart Album Help

    Smart Album help, please! While converting old slides to digital, I am importing to iPhoto in small batches. I have created a "smart album" for the converted slides expecting successive imports would automatically install into that "converted slides" titled smart album. It's not happening. ? ? ? I titled the 2nd imported batch "converted slides". This 2nd import is sitting in "Last Roll" rather than automatically moving to the smart album. How do I move this 2nd batch of 242 photos from "Last Roll" into its designated album? I tried "drag n drop" the whole roll, perusing iPhoto help menu, to no avail. HELP!
    Neophyte NaNa

    On further review of the iPhoto Help menu, it seems that an "Album" is much more flexible than the smart album. Can I change a smart album into a regular album? Or, I've created a "folder" for the smart album. Now, if I "Trash" the smart album, will the folder of slides remain? My right shoulder aches from too many hours on this project, that now I'm afraid to try anything for fear of loosing all that work. SHEEESH.
    NN

  • Access model for smart tabs: Can the new tab have a different ACL?

    Access model for smart tabs: Can the new tab have a different access control list then the sources it draws from?
    Scenario: Some lecture content is in a private course viewable to course members only and some is put on a public page viewable to all. Can the content on the smart tab viewable to the public have different permissions?
    Scenario: Public site starts with small number of courses, say 16, located in 4 sections on the main welcome tab. Administrators have edit only rights to the Welcome page and grant editing rights to each of the course pages to others. A few months later the site has more content and decides to change the four sections on the Welcome page to four section pages with courses attached to it. The new pages would have new editors for them. Can the course pages originally located on the main welcome page be restricted to no viewers and smart tabs put in new courses connected to the new section tabs? The thought here is to avoid rebuilding the site as the architecture changes.
    All comments appreciated!
    Bill Corrigan,
    University of Washington

    The Ask Toolbar is causing that in the Firefox 3.6.13+ versions. Uninstall that extension.
    There are a couple of places to check for the Ask toolbar:
    * Check the Windows Control panel for the Ask Toolbar - http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4
    * Also check your list of extensions, you may be able to uninstall it from there - https://support.mozilla.com/kb/Uninstalling+add-ons

  • Smart Tab matching question

    We have two Smart Tabs that are presenting us with a challenge.
    Tab 1: Sterling Memorial Library
    Album name matches "Sterling Memorial Library"
    Tab 2: Sterling Memorial Library Tour
    Album name matches "Sterling Memorial Library Tour"
    Our problem is that Tab 2 content is showing up in Tab 1 and we don't want it there. It appears that the issue is that Smart Tabs don't do exact matches.
    Question: is there any way to overcome this problem without renaming our Albums. For example, I tried to put double quotes around the matching term to indicate that I only wanted those three words, but that didn't work.
    Any ideas?
    Thanks.
    -Chris

    Chris, I haven't verified this with a test, but I bet it would work. If not, lunch is on me.
    When specifying smart tab search criteria, the term "matches" should be read as "contains the substring". This is likely what you want most of the time. You're likely to say, for example, "I want to create a smart tab with stuff of interest to French students ... so I'll search for tracks whose "Title" matches "French".
    Problem is that "Sterling Memorial LIbrary" is a proper substring of "Sterling Memorial Library Tour" ... you have to break that connection to get the results you want. The simplest was is to that would be like this:
    Tab 1: Sterling Memorial Library
    Album name matches "Sterling Memorial Library"
    Tab 2: Sterling Memorial Library Tour
    Album name matches "Memorial Library Tour"
    See? Neither string is a proper substring of the other ... so they must return disjoint results.

  • HT5500 The facebook app stays installed and it's greyed out. When I go to redown load it from itunes, it just has an open tab and not a install tab. help

    After I upgraded tothe IOS 6 operating system on my iphone 3GS I lost several of my apps. They don't show up anymore. I tried to reinstall them again using itunes, but they just show an "open" tab instead of an "install" tab. When I click open, it brings up the app. I can't figure out how to install the app on my phone again. Help....When I look at my phone the apps are there under settings but not on the phone as an app.

    Look at the various screens on your iPhone, the app is there somewhere. Don't forget to also look in folders.

  • Spry Blue Tab Helper gone...

    I am attempting to use the Spry Text Validator for a page on my site, but I cannot get the blue tab to appear to edit the properties. This is kind of interesting, because they work on my pages that were created in the root folder, but I'm having my issues with pages in other folders (ie, site_root/folder/webpage.php). The only other difference I've come across is that I have created my Server Behaviors first on the pages I'm having issues with, and with the pages that the Spry blue tabs appear, I created the Server Behaviors after adding Spry Validation. Also, I have confirmed the the Spry .js and .css are pointing to the correct folder and files. Any help would be appreciated!
    Update:
    So I have found the issue, but I don't know how to resolve it. When I create a Spry Validation Text Field, an object is not being created. For example, there is no:
    <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    //-->
    </script>
    being created on my page. If I manually create it, the blue tab will appear. However, I have to do this for every Spry Validation object I create. Why is this? Is it something I'm doing?

    Hi,
    I often come across similar issues using DW. I do not believe it is a Spry related issue, but one of DW.
    My solution to the text input validation field is to first create normal form fields and then convert them to Spry validation form fields. This works fine because the extra mark-up is automatically created.
    I hope this helps.
    Ben

  • Smart Guitar help...

    Wondering if it's possible to get different guitar pedals/FX for Smart Guitar in GB app for iPad
    The only reason I ask is because I saw a couple youtube videos where people were playing familiar tunes and riffs on SG (AC/DC, GnR...) and they sounded almost spot-on to the actual guitar sounds that are naturally in the riffs. 
    Naturally, they may have had the iPad output going through an external unit for the modulation, but nonetheless it would seem possible to add "in-app" purchases for such pedals and I'm wondering if this exists.

    This is the limitation in GarageBand for iPad. You can use (import) different effects, regardelss if there are stompboxes, amps or synth. You only can work with the parameters of the provded effects and sounds.
    If you think about how difficult it is just to get audio files and Apple Loops into the iPad, imagine dealing with external plugins. May in the future with  iOS12.
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • GUIDE TO SMART FORM- HELP NED

    HELLO FRIENDS - I M TRYING TO MAKE SMARTFORM FOR FIRST TIME BUT I AM NOT ABLE TO DEVELOP THEM , PLS HELP ME OUT WITH SOME SIMPLE PROCEDURE

    Hi,
    1. Go to transaction Smartforms
    2. Enter a name against form zzz_form.Click create.
    3. Create a text element by right clicking the main window.In the right hand side window,write
    'Heelo Smartform'.
    4.Click activate button(ctrl +f3).Then execute it by pressing f8.Then you will get a function module.Then press f8.Then again f8 will give you the output.
    This is the small example.You will do good programming if you started observing sf_example_01 and sf_example_02 standard smartforms.
    These links will help you.
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    Kindly reward points by clicking the star on the left of reply,if it helps.

  • Smart Album help - pictures without Keywords

    How can I create a Smart Album for pictures that don't have a Keyword attached to them? I'm trying to put Keywords to all my pictures and would like to be able to use a Smart Album to help me get through this project.
    Thanks.
    Chip

    Thanks. I had it on "contains" and there isn't a pulldown menu for that. Never even thought to change it to the other choices to see what that offered.

  • Leaders and tabs help!

    Hi,
    I am having a lot of trouble getting my second (and third) line to line up under "dolor" the only way so far I've come near is by changing my alignment to right - but this is no good as I need it to be left alignment.
    I've created this using the paragraph styles and the tabs, any help would be very much appreciated
        1. Lorem ipsum.....................................dolor sit. amet,
    consectetuer adipiscing ipsum, porttitor in, gravida vitae, cursus et, sem.
    Many thanks

    The other way you could do it is with the tabs panel
    In the paragraph style go to Tabs
    Then select the tab you've inserted. Note the measurement
    Select the Indent and insert the same measurement for the indent
    Hold down shift and drag the top piece of the indent back.
    That will make it part of that Style.
    But I've had issues with Tabs, Tab Leaders, and Indents are are at the same place; when exporting to pdf.

  • Smart playlists - help!

    Hi Everyone I have a few smart playlist questions. This is a bit long so bear with me.
    1. Lets say there is an artist Joe Smith. Joe used to record as Joey Smith. Joe also recorded a Christmas album. How do I create a playlist that includes Joe, Joey, no Christmas songs and with that cridera use the option play songs not played in 1 day?
    2. My next question which is somewhat similar - can I do the above with two or more artist on one smart playlist?
    3. With the above two questions, tHe only option I could think of was to create various smart playlists and a third one merging both together. Now if I do that will that cause problems? For example if I say on each playlist play songs that haven't been played in 1 day, then I do the same thing on the third playlist will that cause "wires to cross" and I'll end up with nothing in the playlist?
    4. Last but not least... is there a way to just add one particular song to a smart playlist? I could not figure out how to do it. I could only find albums.
    It seems like when I say match all criteria with these questions I can solve one issue another one arrises. Any help would be appreciated. I am new to using smart playlists, ipods in general (just bought mine a few months ago) and am somewhat lost in the process. Thanks for your help, Christina

    1. You have to use multiple playlists like you mentione in your #3. This is becuase smart playlists can "match all" or "match any", but can't use "match x OR y".
    Genre is not Holiday
    Last played is not in the last 1 days
    2. Yes
    3. Not a problem, I've done it....but sometimes I make mistakes and have to tweak the various playlists.
    4. Name is what iTunes uses for track name.

Maybe you are looking for

  • HTTP reciever adapter pass URL parameters

    Hello all, I have a question regarding passing parameters as querystring in the url of reiever HTTP adapter. This is an RFC> XI> HTTP scenario and we're posting to an external URL. Here are the details URL: xxxx.yyyyy.com Service Number: 80 Path: /ap

  • Most efficient way to loop through similarly named fields?

    Hi, I have a 5 page document with each page containing appx. 50 similarly named fields.    E.g. Viol1Num, Viol2Num, Vio3Num ...  Viol50Num. I am looking for an efficient way of programming a loop to look at each field in Javascript so I can do some m

  • My Ipod software won't update

    I can't get my software on my ipod to update from 1.1 to 1.2 everytime I try it just says something about an unknown error 1417 anyone have any ideas???   Windows XP Pro  

  • Proxy settings in NWDS 7.1 EHP1 for accessing ES workplace

    hi I have done the service registry settings in NWDS to access the ES workplace.  i have selected the option "direct connection to internet" in the general-> network connections settings.when i am working from my home this is working fine. but the sa

  • Labview stops when computer is locked

    We are running Labview 2011.  After some time of no user interaction the computer is locked by Windows XP.  Supposedly programs should be able to keep running while the computer is locked.  My Labview code doesn't.  Does anyone know what's going on?