Help needed refactoring my AutofillTextField

Hello everyone,
Implementing an autofill feature for JTextField raised several design issues, and I would like some help.
First, source code, demo and a diagram can be found on my JRoller entry: http://www.jroller.com/page/handcream?entry=refactoring_challenge_autocomplete_jtextfield
Most difficulties are due to the mix of input and output. I imply what was auto-filled by selecting that part of the text. This affects the input on the other end.
An auto-filled selection doesn't behave like a normal one. Backspace will delete both the selection and an extra character. After that it immediately searches for a match, and auto-fills if necessary.
Adding characters in the middle and getting a match, advances the caret as normal, but also auto-selects the text from that point. So the output "talks" to the input to get the normal caret position.
To intercept text changes in JTextField I override PlainDocument, but other objects need access to the original, super-class methods. For this they use an inner class with methods wrapping the super-class methods.
I wonder if this overriding forces some dirty code, or maybe I can always abstract it away. Maybe I must intercept text changes some other way to make everything cleaner, like removing all keyListeners and add my own. But I doubt that.
My guess is that i'm just unable yet to see the right abstractions, and maybe I didn't go far enough with seperation. Anyway, I need help :). I tried not to ask, but this is going on for too long.
Thanks,
Yonatan.
Some code:
public interface Output {
     void showMatch(String userInput, String fixedInput, String fill);
     void showMismatch(String userInput);
public interface Processor {
     void match(String userInput, Output output);
public interface RealDocument {
     void insertString(int offset, String addition);
     void remove(int offset, int length);
     void clear();
     String getText();
public class AutoFillDocument extends javax.swing.text.PlainDocument {
     @Override
     public void insertString(int offset, java.lang.String addition, javax.swing.text.AttributeSet attributes) throws javax.swing.text.BadLocationException {
          replacing = false;
          String proposedValue = new StringBuilder(real.getText()).insert(offset, addition).toString();
          TextFieldOutput output = new TextFieldOutput(field, real, new DefaultInsert(offset, addition));
          search.match(proposedValue, output);
          autoFilledState = output.autoFilled();
     @Override
     public void remove(int offset, int length) throws javax.swing.text.BadLocationException {
          if (replacing) {
               real.remove(offset, length);
               replacing = false;
          } else {
               removeDirect(offset, length);
     private void removeDirect(int offset, int length) {
          if (backspacing && autoFilledState) {
               offset--;
               length++;
          removeDelegate(offset, length);
     private void removeDelegate(int offset, int length) {
          String proposedValue = new StringBuilder(real.getText()).delete(offset, offset + length).toString();
          TextFieldOutput output = new TextFieldOutput(field, real, new DefaultRemove(offset, length));
          search.match(proposedValue, output);
          autoFilledState = output.autoFilled();
     @Override
     public void replace(int arg0, int arg1, java.lang.String arg2, javax.swing.text.AttributeSet arg3) throws javax.swing.text.BadLocationException {
          replacing = true;
          super.replace(arg0, arg1, arg2, arg3);
     public AutoFillDocument(yon.ui.autofill.Processor search, javax.swing.JTextField field) {
          this.search = search;
          this.field = field;
          field.addKeyListener(new java.awt.event.KeyAdapter() {
               public void keyPressed(java.awt.event.KeyEvent e) {
                    backspacing = java.awt.event.KeyEvent.VK_BACK_SPACE == e.getKeyCode();
     yon.ui.autofill.Processor search;
     javax.swing.JTextField field;
     boolean backspacing = false;
     boolean autoFilledState = false;
     boolean replacing = false;
     public final RealDocument real = new RealDocument();
     private class RealDocument implements yon.ui.autofill.RealDocument {
          public void insertString(int offset, String addition) {
               try {
                    AutoFillDocument.super.insertString(offset, addition, null);
               } catch (Exception ex) {
                    throw new RuntimeException(ex);
          public void remove(int offset, int length) {
               try {
                    AutoFillDocument.super.remove(offset, length);
               } catch (Exception ex) {
                    throw new RuntimeException(ex);
          public void clear() {
               try {
                    AutoFillDocument.super.remove(0, AutoFillDocument.super.getLength());
               } catch (Exception ex) {
                    throw new RuntimeException(ex);
          public String getText() {
               try {
                    return AutoFillDocument.super.getText(0, AutoFillDocument.super.getLength());
               } catch (Exception ex) {
                    throw new RuntimeException(ex);
     private class DefaultInsert implements yon.ui.autofill.TextFieldOutput.DefaultAction {
          public void execute() {
               real.insertString(offset, addition);
          public DefaultInsert(int offset, String addition) {
               this.offset = offset;
               this.addition = addition;
          private int offset;
          private String addition;
     private class DefaultRemove implements yon.ui.autofill.TextFieldOutput.DefaultAction {
          public void execute() {
               real.remove(offset, length);
          public DefaultRemove(int offset, int length) {
               this.offset = offset;
               this.length = length;
          private int offset;
          private int length;
public class DefaultProcessor implements Processor {
     public void match(String userInput, Output output) {
          String match = startsWith(userInput);
          if (match == null) {
               output.showMismatch(userInput);
          } else {
               output.showMatch(userInput, match.substring(0, userInput.length()), match.substring(userInput.length()));
     public String startsWith(String prefix) {
          yon.utils.IsStringPrefix isPrefix = new yon.utils.IsStringPrefix(prefix);
          for (String option: options) {
               if (isPrefix.of(option)) {
                    return option;
          return null;
     public DefaultProcessor(String[] options) {
          this.options = options;
     String[] options;
public class TextFieldOutput implements Output {
     public void showMatch(String userInput, String fixedInput, String fill) {
          if (!userInput.isEmpty()) {
               if (fill.isEmpty()) { // exact match
                    defaultAction.execute();
                    int caretPosition = field.getCaret().getDot();
                    field.getCaret().setDot(fixedInput.length());
                    field.getCaret().moveDot(caretPosition);
               } else {
                    document.clear();
                    document.insertString(0, fixedInput + fill);
                    field.getCaret().setDot(fixedInput.length() + fill.length());
                    field.getCaret().moveDot(fixedInput.length());
               autoFilled = field.getCaret().getDot() != field.getCaret().getMark();
          } else {
               document.clear();
               autoFilled = false;
     public void showMismatch(String userInput) {
          defaultAction.execute();
          autoFilled = false;
     public boolean autoFilled() {
          return autoFilled;
     public TextFieldOutput(javax.swing.JTextField field, yon.ui.autofill.RealDocument document, DefaultAction defaultAction) {
          this.field = field;
          this.document = document;
          this.defaultAction = defaultAction;
     private javax.swing.JTextField field;
     private yon.ui.autofill.RealDocument document;
     private DefaultAction defaultAction;
     private boolean autoFilled;
     public interface DefaultAction {
          void execute();
public class AutoFillFeature {
     public void installIn(javax.swing.JTextField field) {
          Processor processor = new DefaultProcessor(options);
          AutoFillDocument document = new AutoFillDocument(processor, field);
          field.setDocument(document);          
     public AutoFillFeature(String[] options) {
          this.options = options;
     String[] options;
}

I made the code very simple in the interest of discussion in this forum.
1) Now everything is in one class.
2) I extend DocumentFilter instead of Document, which already implements the acrobatics I tried earlier.
3) I Commented most parts of the code.
How would you refactor it? It can be as simple as splitting into more methods, but you can also introduce more objects, and maybe even use a GoF pattern.
Here is the code. Good luck :)
package yon.ui.autofill;
public class AutoFillFilter extends javax.swing.text.DocumentFilter {
     // Called when user tries to insert a string into a text-box.
     // bypass - can change the text without causing a recursion.
     // offset - where to insert
     // addition - what to insert
     // attributes - mostly ignored
     @Override
     public void insertString(FilterBypass bypass, int offset, String addition, javax.swing.text.AttributeSet attributes) throws javax.swing.text.BadLocationException {
          bypass.insertString(offset, addition, attributes);
          handleInput(bypass, currentValue(bypass));
     // Called when user tries to remove a string in a text-box.
     // bypass - can change the text without causing a recursion.
     // offset - where to start removal
     // length - how much to remove
     @Override
     public void remove(FilterBypass bypass, int offset, int length) throws javax.swing.text.BadLocationException {
          if (backspacing && autoFilled) {
               offset--;
               length++;
          bypass.remove(offset, length);
          handleInput(bypass, currentValue(bypass));
     // Called when user tries to replace a string in a text-box.
     // bypass - can change the text without causing a recursion.
     // offset - replaced section start
     // length - replaced section length
     // substitution - ...
     // attributes - mostly ignored
     @Override
     public void replace(FilterBypass bypass, int offset, int length, String substitution, javax.swing.text.AttributeSet attributes) throws javax.swing.text.BadLocationException {
          bypass.remove(offset, length);
          insertString(bypass, offset, substitution, null);
     // Searching for a match and auto-fill.
     // bypass - can change the text without causing a recursion.
     // input - user input
     private void handleInput(FilterBypass bypass, String input) {
          String match = options.firstStartsWith(input);
          handleMatchResult(match, input, bypass);
     // Check match and display in text-box accordingly.
     // match - result from searching options
     // input - raw input from user
     // bypass - can change the text without causing a recursion.
     private void handleMatchResult(String match, String input, FilterBypass bypass) {
          // If no match, or match was default (empty string is prefix of anything)
          //   leave text-box as it is.
          // If matched, imply by selecting the autu-filled section.
          if (match == null || input.isEmpty()) {
               autoFilled = false;
          } else {
               showMatch(bypass, match);
     // Displays text with auto selected section.
     // It knows where to start selecting according to the current caret state.
     private void showMatch(FilterBypass bypass, String match) {
          int caretPosition = field.getCaret().getDot();
          clear(bypass);
          bypassInsertString(bypass, 0, match);
          mark(match.length(), caretPosition);
          autoFilled = field.getCaret().getDot() != field.getCaret().getMark();
     // Convenience method to get the whole text-box text.
     private String currentValue(FilterBypass bypass) {
          try {
               return bypass.getDocument().getText(0, bypass.getDocument().getLength());
          } catch (Exception ex) {
               throw new RuntimeException(ex);
     // Convenience method to insert a string to text-box.
     private void bypassInsertString(FilterBypass bypass, int offset, String addition) {
          try {
               bypass.insertString(offset, addition, null);
          } catch (Exception ex) {
               throw new RuntimeException(ex);
     // Convenience method to clear all text from text-box
     private void clear(FilterBypass bypass) {
          try {
               bypass.remove(0, bypass.getDocument().getLength());
          } catch (Exception ex) {
               throw new RuntimeException(ex);
     // Convenience method to mark (select) a text-box section
     private void mark(int from, int to) {
          field.getCaret().setDot(from);
          field.getCaret().moveDot(to);
     // Constructor
     // Registers a listener to BACKSPACE typing, so we don't just delete a selection,
     //   but delete one extra character. otherwise users can't backspace more than once,
     //   if their input was auto-filled.
     // Registers a listener to text-box caret, so we know if a section of text-box is
     //   selected automatically by us. (it helps together with backspace to delete one
     //   extra character.
     public AutoFillFilter(javax.swing.JTextField field, Options options) {
          this.options = options;
          this.field = field;
          // Similar to C# delegator.
          this.field.addKeyListener(new java.awt.event.KeyAdapter() {
               public void keyPressed(java.awt.event.KeyEvent e) {
                    backspacing = java.awt.event.KeyEvent.VK_BACK_SPACE == e.getKeyCode();
          // Similar to C# delegator.
          field.getCaret().addChangeListener(new javax.swing.event.ChangeListener() {
               public void stateChanged(javax.swing.event.ChangeEvent arg0) {
                    autoFilled = false; // Factory trusts Output to set it only after changing caret, so next caret change fill cancel autofill.
     // Was the current text auto-filled and now in an auto-selection state?
     private boolean autoFilled;
     // Options to match against when trying to auto-fill.
     private Options options;
     // Did the user just pressed Backspace?
     private boolean backspacing = false;
     // The text-box.
     javax.swing.JTextField field;
// One extra class if anyone wants to build and run it.
package yon.ui.autofill;
public class Options {
     public String firstStartsWith(String prefix) {
          yon.utils.IsPrefix isPrefix = new yon.utils.IsPrefix(prefix);
          for (String option: options) {
               if (isPrefix.of(option)) {
                    return option;
          return null;
     public Options(String... options) {
          this.options = options;
     String[] options;
// Oh and this one for prefix checking:
package yon.utils;
public class IsPrefix {
     public boolean of(String str) {
          return str.regionMatches(true, 0, prefix, 0, prefix.length());
     public IsPrefix(String prefix) {
          this.prefix = prefix;
     String prefix;
// And a demo so you have a quick start.
package yon.ui.autofill;
public class MiniApp {
     public static void main(String[] args) {
          javax.swing.SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    javax.swing.JTextField field = new javax.swing.JTextField();
                    Options options = new Options("English", "Eng12lish", "French", "German", "Heb", "Hebrew");
                    makeAutoFill(field, options);
                    javax.swing.JLabel label = new javax.swing.JLabel("English, Eng12lish, French, German, Heb, Hebrew");
                    javax.swing.JPanel panel = new javax.swing.JPanel();
                    panel.setLayout(new javax.swing.BoxLayout(panel, javax.swing.BoxLayout.PAGE_AXIS));
                    panel.add(field);
                    panel.add(javax.swing.Box.createVerticalStrut(10));
                    panel.add(label);
                    javax.swing.JFrame frame = new javax.swing.JFrame();
                    frame.add(panel);
                    frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
                    frame.pack();
                    frame.setVisible(true);
     public static void makeAutoFill(javax.swing.JTextField field, Options options) {
          javax.swing.text.PlainDocument document = new javax.swing.text.PlainDocument();
          document.setDocumentFilter(new AutoFillFilter(field, options));
          field.setDocument(document);     
}

Similar Messages

  • Troubleshoting help needed:  My iMac keeps crashing and restarting with a report detail: "spinlock application timed out"  What can I do to fix this?timed out"

    Troubleshooting help needed:  My iMac keeps crashing and restarting with a notice: "Spinlock application timed out"  What can I do?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the page that opens.
    Select the most recent panic log under System Diagnostic Reports. Post the contents — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post shutdownStall, spin, or hang reports.

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Help needed I have a canon 40D. I am thinking of buying a canon 6D.But not sure that my len

    Hi all help needed I have a canon 40D. I am thinking of buying a canon 6D.
    But not sure that my lenses will work.
    I have a 170mm/ 500mm APO Sigma.
    A 10/20 ex  Sigma   HSM  IF.
    And a 180 APO Sigma Macro or do I have to scrap them and buy others.
    ALL Help will be greatly received. Yours  BRODIE

    In short, I love it. I was going to buy the 5DMark III. After playing with it for a while at my local Fry's store where they put 5DMII, 5DMIII and 6D next to each other, using the same 24-105L lens, I decided to get the 6D and pocket the different for lens later.
    I'm upgrading from the 30D. So I think you'll love it. It's a great camera. I have used 5DMII extensively before (borrowing from a close friend).
    Funny thing is at first I don't really care about the GPS and Wifi much. I thought they're just marketing-gimmick. But once you have it, it is actually really fun and helpful. For example, I can place the 6D on a long "monopod", then use the app on the phone to control the camera to get some unique perspective on some scenes. It's fun and great. GPS is also nice for travel guy like me.
    Weekend Travelers Blog | Eastern Sierra Fall Color Guide

  • Help needed! Raid degraded again!

    Hi!
    Help needed! I hava made bootable RAID with two S-ATAII 250Gb HDD and its not working! Every now and then at bootup I get a message RAID -> DEGRADED... Must be seventh time! Rebuild takes its own time!
    What am I doing wrong!
    T: Ekku
    K8N Neo4 Ultra
    AMD 64 4200+
    2 Gb RAM
    2 x 250 Gb HDD (Maxtor)
    nVidia RAID (in mb)
    P.S. I wery SORRY with my poor language!

    I'm going to blame the nVRAID because I've seen issues with it in the past. If your motherboard has another non-nVidia RAID solution, use that instead. Using the nVidia SATA ports as BASE or JBOD is fine and dandy but RAIDing always had issues. It's not even a driver issue I think it's just instability. Latest drivers and even boxed drivers never helped. Granted, some will report success with their rig. But on a professional level I've seen nForce issues on different motherboards and different hard drives that had RAID disaster stories.
    Good luck and if you don't have another RAID solution, my suggestion would be to buy a dedicated RAID controller card.
    LPB

  • HELP NEEDED WITH ADDAPTER-DVI TO VGA.

    PLEASE ...HELP NEEDED WITH WIRING CROSS OVER....CAN YOU HELP WITH BACK OF PLUG CONNECTIONS...I SORTA UNDERSTAND THE PINOUTS BUT CANT MAKE AN EXACT MACH...WOULD LIKE TO BE 100% SURE...
    ......THIS ENSURES NO SMOKE!!!                                                                                           
    THE CARD IS AN ATI RADEON RX9250-DUAL HEAD-.........ADDAPTER IS DVI(ANALOG)MALE TO VGA(ANALOG)FEMALE.
    ANY HELP VERY MUCH APPRECIATED........ SEEMS YOU NEED TO BE ROCKET SCI TO ATTACH A BLOODY PICTURE...SO THIS HAS BEEN BIG WASTE OF FING TIME!

    Quote from: BOBHIGH on 17-December-05, 09:21:31
    Get over it mate !
    I find it easy t read CAPS...and if you dont like it ...DONT READ IT!
    And why bother to reply...some people have nothing better to do.
    Yes there chep and easy to come by...Ive already got a new one.
    All I wanted was to make a diagram of whats inside the bloody thing...it was a simple question and required a simple answer.
    NO NEED TO A WANKA !!
    I feel a bann comming up.
    Have you tryed Google ? really.. your question is inrelevant. No need to reply indeed.
    Why do you come here asking this question anyway ? is it becouse you have a MSI gfx card ? and the adapter has nothing to do with this ?
    You think you can come in here yelling.. thinking we have to put up with it and accept your style of posting. This is not a MSI tech center.. it's a user to user center.. Your question has nothing to do with MSI relavant things anyway's.
    Google = your friend.
    Quote from: BOBHIGH on 17-December-05, 09:21:31
    it was a simple question and required a simple answer
    Simple for who ? you (buying a new one) ? me ? we ?   .really...........
    Quote from: Dynamike on 16-December-05, 04:11:48
    1: There are allot of diffrent types of those adapters.
    If any of the mods have a problem about my reply.. please pm me.

  • Help needed for grouping.

    Hi,
        Help needed .
    I have an internal table having 6 .
    Ex :
    f1     f2    f3     f4    f5    f6
    a     aa    11    p1  10    10
    a     aa    12    p1  20    20
    b     aa    11    p2  30    30
    b     aa    12    p2  40    30
    Now i want to sum the fields f5 and f6 individually and need to display based upon the fields f1 and f4.
    To Display :
    f1     f2    f3     f4    f5    f6
    a     aa    11    p1  30    30.
    b     aa    11    p2  70    60.
    can anyone help me.How to do this..?
    Thanks

    Here you go
    DATA:
      BEGIN OF cur_tab OCCURS 0,
        f1        TYPE c,
        f2(2)     TYPE c,
        f3(2)     TYPE c,
        f4(2)     TYPE c,
        f5(2)     TYPE c,
        f6(2)     TYPE n,
      END OF cur_tab.
    DATA:
      BEGIN OF sum_tab OCCURS 0,
        f1        TYPE c,
        f4(2)     TYPE c,
        f5        TYPE p,
        f6        TYPE p,
      END OF sum_tab.
    DATA:
      BEGIN OF final_tab OCCURS 0,
        f1        TYPE c,
        f2(2)     TYPE c,
        f3(2)     TYPE c,
        f4(2)     TYPE c,
        f5(5)     TYPE c,
        f6(5)     TYPE c,
      END OF final_tab.
    START-OF-SELECTION.
      cur_tab-f1 = 'a'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p1'.
      cur_tab-f5 = '10'.
      cur_tab-f6 = '10'.
      APPEND cur_tab.
      cur_tab-f1 = 'a'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p1'.
      cur_tab-f5 = '20'.
      cur_tab-f6 = '20'.
      APPEND cur_tab.
      cur_tab-f1 = 'b'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p2'.
      cur_tab-f5 = '30'.
      cur_tab-f6 = '30'.
      APPEND cur_tab.
      cur_tab-f1 = 'b'.
      cur_tab-f2 = 'aa'.
      cur_tab-f3 = '11'.
      cur_tab-f4 = 'p2'.
      cur_tab-f5 = '40'.
      cur_tab-f6 = '30'.
      APPEND cur_tab.
      LOOP AT cur_tab.
        MOVE-CORRESPONDING cur_tab TO sum_tab.
        COLLECT sum_tab.
      ENDLOOP.
      LOOP AT sum_tab.
        READ TABLE cur_tab WITH KEY f1 = sum_tab-f1
                                    f4 = sum_tab-f4.
        IF sy-subrc NE 0.
          WRITE:/ 'Something went very wrong'.
          CONTINUE.
        ENDIF.
        MOVE-CORRESPONDING cur_tab TO final_tab.
        MOVE-CORRESPONDING sum_tab TO final_tab.
        APPEND final_tab.
      ENDLOOP.
      LOOP AT final_tab.
        WRITE:/1 final_tab-f1,
              AT 5 final_tab-f2,
              AT 10 final_tab-f3,
              AT 15 final_tab-f4,
              AT 20 final_tab-f5,
              AT 25 final_tab-f6.
      ENDLOOP.
    and the output
    a   aa   11   p1     30   30  
    b   aa   11   p2     70   60  

  • Help needed on installation of Oracle 9i on Sun Solaris 8

    Hey,
    Help needed on installation of Oracle 9i EE on Sun Solaris 8. The problem I met was: we followed the installation guide from the documentation. And we selected the choice "install software only". After it was done successfully, we run Database Configuration Assistant utility to create a database instance. But finally it always tried to create the instance at the root directory ( / ) which doesn't have enough space and then failed. The case was that we have set the enviroment parameters: $ORACLE_BASE = /export/mydata, $ORACLE_HOME = /export/apps/oracle9i. That means it should be installed at /export/mydata, but it didn't. Any help or advice are welcome. Thanks.
    Simon

    I have downloaded Oracle 11G R2 version from Windows and extracted it in Windows and copied it into DVD after extraction in two folders. Now I am mounting that DVD in Solaris 10 installed in my VMware . I made a new directory named as 'installation ' under /export/home/oracle and copied the folders from DVD to 'installation' folder. Now I am entering installation folder and try to do ./runInstaller as 'oracle ' user and getting the error mentioned before.
    Edited by: 916438 on Mar 31, 2012 5:55 PM

  • Help needed on installation of Oracle 9i EE on Sun Solaris 8

    Hey,
    Help needed on installation of Oracle 9i EE on Sun Solaris 8. The problem I met was: we followed the installation guide from the documentation. And we selected the choice "install software only". After it was done successfully, we run Database Configuration Assistant utility to create a database instance. But finally it always tried to create the instance at the root directory ( / ) which doesn't have enough space and then failed. The case was that we have set the enviroment parameters: $ORACLE_BASE = /export/mydata, $ORACLE_HOME = /export/apps/oracle9i. That means it should be installed at /export/mydata, but it didn't. Any help or advice are welcome. Thanks.
    Simon

    I have downloaded Oracle 11G R2 version from Windows and extracted it in Windows and copied it into DVD after extraction in two folders. Now I am mounting that DVD in Solaris 10 installed in my VMware . I made a new directory named as 'installation ' under /export/home/oracle and copied the folders from DVD to 'installation' folder. Now I am entering installation folder and try to do ./runInstaller as 'oracle ' user and getting the error mentioned before.
    Edited by: 916438 on Mar 31, 2012 5:55 PM

  • Help needed in Finding Download location for Sun One Portal 7

    Hi,
    help needed for finding download location for Sun ONE Portal 7. I tried to find in Oracle Download page ,
    http://www.oracle.com/us/sun/sun-products-map-075562.html, But unable to find.
    Please share the link for download location.
    I am totally new in Sun ONE Portal.
    Thanks,
    Edited by: 945439 on Oct 5, 2012 3:41 AM

    try edelivery.oracle.com under sun products.

  • Help needed in constructing a tree

    Help needed in constructing a tree. I was wondering if some one can suggest me how to add messages in the second column for both the parent node and child elements.
    I was able to create a tree succefully, but want to add some description in the second column for the first column elements, for both parent and child elements.
    Please suggest me how to add the arrays to second column for parent and child nodes.
    Solved!
    Go to Solution.
    Attachments:
    Tree_fix.vi ‏15 KB

    The Child Text parameter is the one you are searching for. It accepts a 1D string array for the following columns.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Help needed on CD740 ???

    Help needed on CD740 ? My CD740 is GREAT , well , it was great !!? The sound and general performance are wonderful , but , it now has a fault !!? Shock Horror !!
    What can it be ?!!? Well , the display illumination has failed , as in , there isn't any !!? Have to use a torch to read it !!? Not good. Now , here's the thing , I want a phone number (UK zone) ?to talk to an actual human and I cannot find one !!? That is soooooo annoying !!? The unit is out of warranty so I want to repair this myself , no worries , I once worked for Philips in their pro studio equipment repair workshop so I know my way around black boxes !! I would like a service manual though so that I can get the case apart without damage. So , can anyone help me with a phone number , pretty please ?!!
    Thanx.

    I tried compling servlet, but it is raising error
    that coul not find package javax.servletWhat I did not mention... you need to add those JARs in the Classpath explicitly. You will find them in %TOMCAT_HOME%\common\lib. You atleast need to add servlet-api.jar to your Classpath. :)

  • Help needed with Vista 64 Ultimate

    "Help needed with Vista 64 UltimateI I need some help in getting XFI Dolby digital to work
    Okay so i went out and I bought a yamaha 630BL reciever, a digital coaxial s/pdif, and a 3.5mm phono plug to fit perfectly to my XFI Extreme Music
    -The audio plays fine and reports as a PCM stream when I play it normally, but I can't get dolby digital or DTS to enable for some reason eventhough I bought the DDL & DTS Connect Pack for $4.72
    When I click dolby digital li've in DDL it jumps back up to off and has this [The operation was unsuccessful. Please try again or reinstall the application].
    Message Edited by Fuzion64 on 03-06-2009 05:33 AMS/PDIF I/O was enabled under speakers in control panel/sound, but S/PDIF Out function was totally disabled
    once I set this to enabled Dolby and DTS went acti've.
    I also have a question on 5. and Vista 64
    -When I game I normally use headphones in game mode or 2. with my headphones, the reason for this is if I set it on 5. I get sounds coming out of all of the wrong channels.
    Now when I watch movies or listen to music I switch to 5. sound in entertainment mode, but to make this work properly I have to open CMSS-3D. I then change it from xpand to stereo and put the slider at even center for 50%. If I use the default xpand mode the audio is way off coming out of all of the wrong channels.
    How do I make 5. render properly on vista

    We ended up getting iTunes cleanly uninstalled and were able to re-install without issue.  All is now mostly well.
    Peace...

  • Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Hi there
    I'll pass your details to our Russian team and they'll contact you to assist further.
    Kind regards
    Bev

  • Help needed : Extension manager cs6 not listing products

    Help needed to Adobe extension manager cs6 to show all my cs6 products
    I downloaded Extension manager from here Adobe - Exchange : Download the Adobe Extension Manager
    My Computer windows xp 32bit
    My Photosop version cs6
    My Dreamweaver version cs6
    I installed photoshop here : C:\Program Files\Adobe\Adobe Dreamweaver CS6
    and my XManConfigfile
    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration>
        <VariableForExMan>
            <Data key="$sharedextensionfolder">$shareddatafolder/Adobe/Dreamweaver CS6/$LOCALE/Configuration/Extensions</Data>
            <Data key="$dreamweaver">$installfolder</Data>
            <Data key="$dreamweaver/Configuration">$userdatafolder/Adobe/Dreamweaver CS6/$LOCALE/Configuration</Data>
            <Data key="$UserBinfolder">$userdatafolder/Adobe/Dreamweaver CS6/$LOCALE</Data>
            <Data key="NeedOperationNotification">true</Data>
            <Data key="QuitScript">dw.quitApplication()</Data>
            <Data key="SupportedInSuite">CS6</Data>
            <Data key="HostNameForCSXS">DRWV</Data>
            <Data key="ProductVersion">12.0</Data>
            <Data key="Bit">32</Data>
    <Data key="DefaultLocale">en_US</Data>
    </VariableForExMan> 
    </Configuration>
    Extension manager installed here : C:\Program Files\Adobe\Adobe Extension Manager CS6
    Photoshop Installed here: C:\Program Files\Adobe\Adobe Photoshop CS6
    and my XManConfigfile
    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration>
        <VariableForExMan>
            <Data key="EmStorePath">$SharedRibsDataFolder/Adobe/Extension Manager</Data>
            <Data key="$photoshopappfolder">$installfolder</Data>
            <Data key="$pluginsfolder">$photoshopappfolder/Plug-Ins</Data>
            <Data key="$presetsfolder">$photoshopappfolder/Presets</Data>
            <Data key="$platform">Win</Data>
            <Data key="$actions">$presetsfolder/Actions</Data>
            <Data key="$blackandwhite">$presetsfolder/Black and White</Data>
            <Data key="$brushes">$presetsfolder/Brushes</Data>
            <Data key="$channelmixer">$presetsfolder/Channel Mixer</Data>
            <Data key="$colorbooks">$presetsfolder/Color Books</Data>
            <Data key="$colorrange">$presetsfolder/Color Range</Data>
            <Data key="$colorswatches">$presetsfolder/Color Swatches</Data>
            <Data key="$contours">$presetsfolder/Contours</Data>
            <Data key="$curves">$presetsfolder/Curves</Data>
            <Data key="$customshapes">$presetsfolder/Custom Shapes</Data>
            <Data key="$duotones">$presetsfolder/Duotones</Data>
            <Data key="$exposure">$presetsfolder/Exposure</Data>
            <Data key="$gradients">$presetsfolder/Gradients</Data>
            <Data key="$huesat">$presetsfolder/Hue Sat</Data>
            <Data key="$imagestatistics">$presetsfolder/Image Statistics</Data>
            <Data key="$keyboardshortcuts">$presetsfolder/Keyboard Shortcuts</Data>
            <Data key="$layouts">$presetsfolder/Layouts</Data>
            <Data key="$lenscorrection">$presetsfolder/Lens Correction</Data>
            <Data key="$levels">$presetsfolder/Levels</Data>
            <Data key="$liquifymeshes">$presetsfolder/Liquify Meshes</Data>
            <Data key="$menucustomization">$presetsfolder/Menu Customization</Data>
            <Data key="$optimizedcolors">$presetsfolder/Optimized Colors</Data>
            <Data key="$optimizedoutputSettings">$presetsfolder/Optimized Output Settings</Data>
            <Data key="$optimizedsettings">$presetsfolder/Optimized Settings</Data>
            <Data key="$patterns">$presetsfolder/Patterns</Data>
            <Data key="$reducenoise">$presetsfolder/Reduce Noise</Data>
            <Data key="$replacecolor">$presetsfolder/Replace Color</Data>
            <Data key="$scripts">$presetsfolder/Scripts</Data>
            <Data key="$selectivecolor">$presetsfolder/Selective Color</Data>
            <Data key="$shadowhighlight">$presetsfolder/Shadow Highlight</Data>
            <Data key="$smartsharpen">$presetsfolder/Smart Sharpen</Data>
            <Data key="$styles">$presetsfolder/Styles</Data>
            <Data key="$textures">$presetsfolder/Textures</Data>
            <Data key="$tools">$presetsfolder/Tools</Data>
            <Data key="$variations">$presetsfolder/Variations</Data>
            <Data key="$webphotogallery">$presetsfolder/Web Photo Gallery</Data>
            <Data key="$workspaces">$presetsfolder/Workspaces</Data>
            <Data key="$zoomify">$presetsfolder/Zoomify</Data>
         <Data key="$hueandsaturation">$presetsfolder/Hue and Saturation</Data>
         <Data key="$lights">$presetsfolder/Lights</Data>
         <Data key="$materials">$presetsfolder/Materials</Data>
         <Data key="$meshes">$presetsfolder/Meshes</Data>
         <Data key="$rendersettings">$presetsfolder/Render Settings</Data>
         <Data key="$volumes">$presetsfolder/Volumes</Data>
         <Data key="$widgets">$presetsfolder/Widgets</Data>
            <Data key="$localesfolder">$photoshopappfolder/Locales</Data>
            <Data key="$additionalplugins">$localesfolder/$LOCALE/Additional Plug-ins</Data>
            <Data key="$additionalpresets">$localesfolder/$LOCALE/Additional Presets</Data>
            <Data key="$localeskeyboardshortcuts">$localesfolder/$LOCALE/Additional Presets/$platform/Keyboard Shortcuts</Data>
            <Data key="$localesmenucustomization">$localesfolder/$LOCALE/Additional Presets/$platform/Menu Customization</Data>
            <Data key="$localesworkspaces">$localesfolder/$LOCALE/Additional Presets/$platform/Workspaces</Data>
            <Data key="$automate">$pluginsfolder/Automate</Data>
            <Data key="$digimarc">$pluginsfolder/Digimarc</Data>
            <Data key="$displacementmaps">$pluginsfolder/Displacement Maps</Data>
            <Data key="$effects">$pluginsfolder/Effects</Data>
            <Data key="$extensions">$pluginsfolder/Extensions</Data>
            <Data key="$fileformats">$pluginsfolder/File Formats</Data>
            <Data key="$filters">$pluginsfolder/Filters</Data>
            <Data key="$imagestacks">$pluginsfolder/Image Stacks</Data>
            <Data key="$importexport">$pluginsfolder/Import-Export</Data>
            <Data key="$measurements">$pluginsfolder/Measurements</Data>
            <Data key="$panels">$pluginsfolder/Panels</Data>
            <Data key="$parser">$pluginsfolder/Parser</Data>
         <Data key="$3dengines">$pluginsfolder/3D Engines</Data>
            <Data key="$lightingstyles">$pluginsfolder/Filters/Lighting Styles</Data>
            <Data key="$matlab">$photoshopappfolder/MATLAB</Data>
            <Data key="UserExtensionFolder">$photoshopappfolder</Data>
            <Data key="$photoshop">$UserDataFolder/Adobe/Adobe Photoshop CS6/Configuration</Data>
            <Data key="DisplayName">Photoshop CS6 32</Data>
            <Data key="ProductName">Photoshop32</Data>
            <Data key="FamilyName">Photoshop</Data>
            <Data key="ProductVersion">13.0</Data>
            <Data key="IconPath">Configuration/PS_exman_24px.png</Data>
            <Data key="SupportedInSuite">CS6</Data>
            <Data key="HostNameForCSXS">PHSP</Data>
            <Data key="Bit">32</Data>
        </VariableForExMan> 
    </Configuration>
                                                                        Please someone help me i cant install any photoshop extension because of this issue,,,

    Waiting for your reply ...thanks
    Here is the results
    I installed photoshopcs6 illustrator cs6 dreamweaver cs6 illustrator cs6 in the system , But nothing seems
    Result: BridgeTalk Diagnostics
      Info:
      Name = estoolkit-3.8
      Status = PUMPING
      Path
      Version = 2.0
      Build = ES 4.2.12
      Next serial number = 40
      Logging: = OFF
      Now = 15:55:49
      Messages:
      Message Version = 2.05
      Authentication = ON
      Digest = ON
      Thread: estoolkit-3.8#thread
      Avg. pump interval = 55ms
      Last pump = 62ms ago
      Ping: 7
      ECHO_REQUEST: ECHO_RESPONSE
      Timeout = undefined
      Handler = undefined
      STATUS: PUMPING
      Timeout = undefined
      Handler = undefined
      MAIN: MAIN
      Timeout = undefined
      Handler = installed
      LAUNCHED: LAUNCHED
      Timeout = undefined
      Handler = installed
      DIAGNOSTICS: DIAGNOSTICS
      Timeout = undefined
      Handler = installed
      INFO: INFO
      Timeout = undefined
      Handler = installed
      SETUPTIME: thread=0ms, left=16ms
      Timeout = undefined
      Handler = undefined
      Instances: 3
      estoolkit-3.8#dbg:
      msg[15:55:49]: 00000035
      @BT>Version = 2.05
      Target = estoolkit-3.8#dbg
      Sender = estoolkit-3.8#dbg
      Sender-ID = localhost:win3788
      Timeout = 15:55:50
      Type = Ignore
      Response-Request = Timeout
      Headers = (no headers)
      Timestamp = 15:55:49
      Serial-Number = 35
      Received = undefined
      Result = undefined
      Error = undefined
      Body = (empty)
      Incoming: 1
      Outgoing: 0
      Handler: 9
      ExtendScript = for all messages
      Error = for only msg #25
      Error = for only msg #27
      Error = for only msg #31
      Result = for only msg #35
      Error = for only msg #35
      Timeout = for only msg #35
      Result = for only msg #37
      Error = for only msg #37
      estoolkit-3.8#estk:
      msg[15:55:49]: 00000037
      @BT>Version = 2.05
      Target = estoolkit-3.8#estk
      Sender = estoolkit-3.8#dbg
      Sender-ID = localhost:win3788
      Timeout = 16:05:49
      Type = Debug
      Response-Request = Result Error
      Headers = (no headers)
      Timestamp = 15:55:49
      Serial-Number = 37
      Received = undefined
      Result = undefined
      Error = undefined
      Body: 107 bytes
      Text = <get-properties engine="main" object="$.global" exclude="undefined,builtin,prototype" all="true" max="20"/>
      Incoming: 1
      Outgoing: 0
      Handler: 1
      ExtendScript = for all messages
      estoolkit-3.8: (main)
      Incoming: 0
      Outgoing: 0
      Handler: 1
      ExtendScript = for all messages
      Targets: 1
      Connector = PCD
      Installed: 0
      Running: 0
      exman-6.0:
      Path = C:\Program Files\Adobe\Adobe Extension Manager CS6\Adobe Extension Manager CS6.exe
      Display Name = Adobe Extension Manager CS6
      MsgAuthentication = ON
      MsgDigest = ON
      ESTK = OFF
      BundleID = com.adobe.exman
      Status = (not running)
      ExeName = Adobe Extension Manager CS6.exe
      Installed: 1
      Running: 0
      Groups = (no groups defined)

Maybe you are looking for

  • How to develop/print a report wider than 8.5 inches, why cant we landscape

    Hi All Gurus, I am new to Oracle Reports. I have a problem, I have a report that has rows longer than normal A4, A5, A6 paper width, so report lines either tend to go on next page or on next line of the same page. Also Oracle Report is not allowing m

  • How to restore my computer if I have updated my osx...

    I want clean computer and reinstall.

  • Mail.app 4.4 (1082) - EXC_BAD_ACCESS (SIGSEGV) + KERN_INVALID_ADDRESS

    Hi all, Mail.app has been crashing ever since the latest update to 4.4 (combo update). Crash reports have been sent to Apple. Below an excerpt: Process: Mail [199] Path: /Applications/Mail.app/Contents/MacOS/Mail Identifier: com.apple.mail Version: 4

  • Base64 Encoding in SOA 11.1.1.5.0

    Hi All, For writing a String to a Flat File(Opaque Schema) using FileAdapter the string needs to be converted to Base64 Encoding I am not able to Encode the string to base64 in BPEL 11g. JDEVELOPER VERSION.Studio Edition Version 11.1.1.5.0 SOA Suite

  • Re: file input/output

         private class PurchaseButtonHandler implements ActionListener                                    throws ExceptionClasses don't throw exceptions. Methods do. Remove the 2nd line.