More help with GREP needed

I have been attempting to create some nested styles.
So far, I am getting the hang of it.
I have created a grep style that will make all text after the word "NOTE: " into italic. Also, I have grep style that makes all text that is "FIGURE +\d+\d" into bold text.
The problem I have is that if the word "FIGURE " etc. is in the italicized note text, then it will not become bold.
For example: "Operate the switch to begin the process (FIGURE 3-3). Make sure guards are closed (refer to FIGURE 3-1)."
That works fine, and "FIGURE " is bold. However, when I change the sentence by adding "NOTE: Make sure guards... " it all becomes italic, and I loose the bold on "FIGURE 3-1"
So, is there a way to augment my italic grep with some kind of inclusion... as if I were saying "if "FIGURE +\d+\d" make that is bold italic"
sorry for the long-winded attempt to describe what I want to do.
Thanks in advance for help.
RPP

RPP,
The trouble is that in GREP style you can find text but not formatting, so you can't say something like "find FIGURE only when it's italic". In the Find/Change dialog you can, but in GREP styles you can't.
You also can't say "look for FIGURE if it's preceded by NOTE: and any characters in between". Unfortunately, lookbehind can't cope with variable-length text. So if you always have "NOTE: Refer to FIGURE ...", then you can use lookbehind and you set-up would be this:
apply italic to FIGURE [-\d]+
apply bold to NOTE:.+
apply bold-italic to (?<=NOTE: Refer to )FIGURE [-\d]+
The first parenthetical is a lookbehind: in this case, FIGURE looks behind, meaning you find FIGURE only when it's preceded by "Note: Refer to", which is not matched itself. So bold italics would be applied only to FIGURE [-\d]+, and only when preceded by ...
But you're not likely to have such fixed text. When you have just a few alternatives, you can list them as alternatives, so if you always have "Note: Refer to " or "NOTE: See " you could salvage your set-up, but with more than let's say three alternatives it gets messy.
(?<=NOTE:.+? )FIGURE [-\d]+ , which you would hope would match any text from NOTE: to FIGURE, doesn't work as a lookbehind.
Peter

Similar Messages

  • Need more help with a GUI

    It's the ever popular Inventory program again! I'm creating a GUI to display the information contained within an array of objects which, in this case, represent compact discs. I've received some good help from other's posts on this project since it seems there's a few of us working on the same one but now, since each person working on this project has programmed theirs differently, I'm stuck. I'm not sure how to proceed with my ActionListeners for the buttons I've created.
    Here's my code:
    // GUICDInventory.java
    // uses CD class
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class GUICDInventory extends JFrame
         protected JPanel panel; //panel to hold buttons
         protected JPanel cdImage; // panel to hold image
         int displayElement = 0;
         public String display(int element)
                   return CD2[element].toString();
              }//end method
         public static void main( String args[] )
              new GUICDInventory();
         }// end main
         public GUICDInventory()
              CD completeCDInventory[] = new CD2[ 5 ]; // creates a new 5 element array
             // populates array with objects that implement CD
             completeCDInventory[ 0 ] = new CD2( "Sixpence None the Richer" , "D121401" , 12 , 11.99, 1990 );
             completeCDInventory[ 1 ] = new CD2( "Clear" , "D126413" , 10 , 10.99, 1998 );
             completeCDInventory[ 2 ] = new CD2( "NewsBoys: Love Liberty Disco" , "2438-51720-2" , 10 , 12.99, 1999 );
             completeCDInventory[ 3 ] = new CD2( "Skillet: Hey You, I Love Your Soul" , "D122966" , 9 , 9.99, 1998 );
             completeCDInventory[ 4 ] = new CD2( "Michael Sweet: Real" , "020831-1376-204" , 15 , 12.99, 1995 );
             //declares totalInventoryValue variable
                 double totalInventoryValue = CD.calculateTotalInventory( completeCDInventory );
              final JTextArea textArea = new JTextArea(display(displayElement));
              final JButton prevBtn = new JButton("Previous");
              final JButton nextBtn = new JButton("Next");
              final JButton lastBtn = new JButton("Last");
              final JButton firstBtn = new JButton("First");
              prevBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent ae)
                        displayElement = (//what goe here? ) % //what goes here?
                        textArea.setText(display(displayElement));// <--is this right?
              nextBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent ae)
                          displayElement = (//what goes here? ) % //what goes here?
                        textArea.setText(display(displayElement));// <--is this right?
              firstBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent ae)
                        displayElement = 0;
                        textArea.setText(display(displayElement));// <--is this right?
              lastBtn.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent ae)
                        displayElement = //what goes here?;
                        textArea.setText(display(displayElement));// <--is this right?
              JPanel panel = new JPanel(new GridLayout(1,2));
              panel.add(firstBtn); panel.add(nextBtn); panel.add(prevBtn); panel.add(lastBtn);
              JPanel cdImage = new JPanel(new BorderLayout());
              cdImage.setPreferredSize(new Dimension(600,400));
              JFrame      cdFrame = new JFrame();
              cdFrame.getContentPane().add(new JScrollPane(textArea),BorderLayout.CENTER);
              cdFrame.getContentPane().add(panel,BorderLayout.SOUTH);
              cdFrame.getContentPane().add(new JLabel("",new ImageIcon("cd.gif"),JLabel.CENTER),BorderLayout.NORTH);
              cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              cdFrame.pack();
              cdFrame.setSize(500,200);
              cdFrame.setTitle("Compact Disc Inventory");
              cdFrame.setLocationRelativeTo(null);
              cdFrame.setVisible(true);
         }//end GUICDInventory constructor
    } // end class GUICDInventory
    // CD2.java
    // subclass of CD
    public class CD2 extends CD
         protected int copyrightDate; // CDs copyright date variable declaration
         private double price2;
         // constructor
         public CD2( String title, String prodNumber, double numStock, double price, int copyrightDate )
              // explicit call to superclass CD constructor
              super( title, prodNumber, numStock, price );
              this.copyrightDate = copyrightDate;
         }// end constructor
         public double getInventoryValue() // modified subclass method to add restocking fee
            price2 = price + price * 0.05;
            return numStock * price2;
        } //end getInventoryValue
        // Returns a formated String contains the information about any particular item of inventory
        public String displayInventory() // modified subclass display method
              return String.format("\n%-22s%s\n%-22s%d\n%-22s%s\n%-22s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n  \n" ,
                                       "CD Title:", title, "Copyright Date:", copyrightDate, "Product Number:", prodNumber , "Number in Stock:",
                                       numStock , "CD Price:" , "$" , price , "Restocking fee (5%):", "$", price*0.05, "Inventory Value:" , "$" ,
                                       getInventoryValue() );
         } // end method
    }//end class CD2
    // CD.java
    // Represents a compact disc object
    import java.util.Arrays;
    class CD implements Comparable
        protected String title; // CD title (name of product)
        protected String prodNumber; // CD product number
        protected double numStock; // CD stock number
        protected double price; // price of CD
        protected double inventoryValue; //number of units in stock times price of each unit
        // constructor initializes CD information
        public CD( String title, String prodNumber, double numStock, double price )
            this.title = title; // Artist: album name
            this.prodNumber = prodNumber; //product number
            this.numStock = numStock; // number of CDs in stock
            this.price = price; //price per CD
        } // end constructor
        public double getInventoryValue()
            return numStock * price;
        } //end getInventoryValue
        //Returns a formated String contains the information about any particular item of inventory
        public String displayInventory()
              //return the formated String containing the complete information about CD
            return String.format("\n%-22s%s\n%-22s%s\n%-22s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n%-22s%s%.2f\n  \n" ,
                                       "CD Title:", title, "Product Number:", prodNumber , "Number in Stock:",
                                       numStock , "CD Price:" , "$" , price , "Restocking fee (5%):", "$", price*0.05, "Inventory Value:" , "$" ,
                                       getInventoryValue() );
        } // end method
        //method to calculate the total inventory of the array of objects
        public static double calculateTotalInventory( CD completeCDInventory[] )
            double totalInventoryValue = 0;
            for ( int count = 0; count < completeCDInventory.length; count++ )
                 totalInventoryValue += completeCDInventory[count].getInventoryValue();
            } // end for
            return totalInventoryValue;
        } // end calculateTotalInventory
         // Method to return the String containing the Information about Inventory's Item
         //as appear in array (non-sorted)
        public static String displayTotalInventory( CD completeCDInventory[] )
              //string which is to be returned from the method containing the complete inventory's information
              String retInfo = "\nInventory of CDs (unsorted):\n";
              //loop to go through complete array
              for ( int count = 0; count < completeCDInventory.length; count++ )
                   retInfo = retInfo + "Item# " + (count + 1);          //add the item number in String
                   retInfo = retInfo + completeCDInventory[count].displayInventory();     //add the inventory detail in String
              }// end for
              return retInfo;          //return the String containing complete detail of Inventory
        }// end displayTotalInventory
         public int compareTo( Object obj ) //overlaod compareTo method
              CD tmp = ( CD )obj;
              if( this.title.compareTo( tmp.title ) < 0 )
                   return -1; //instance lt received
              else if( this.title.compareTo( tmp.title ) > 0 )
                   return 1; //instance gt received
              return 0; //instance == received
              }// end compareTo method
         //Method to return the String containing the Information about Inventory's Item
         // in sorted order (sorted by title)
         public static String sortedCDInventory( CD completeCDInventory[] )
              //string which is to be returned from the method containing the complete inventory's information
              String retInfo = "\nInventory of CDs (sorted by title):\n";
              Arrays.sort( completeCDInventory ); // sort array
              //loop to go through complete array
              for( int count = 0; count < completeCDInventory.length; count++ )
                   retInfo = retInfo + "Item# " + (count + 1);     //add the item number in String
                   retInfo = retInfo + completeCDInventory[count].displayInventory(); //add the inventory detail in String
              return retInfo;     //return the String containing complete detail of Inventory
         } // end method sortedCDInventory
    } // end class CD

    nextBtn.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent ae)
                   displayElement = (//what goes here? ) % //what goes here?
                   textArea.setText(display(displayElement));// <--is this right?
    });Above is your code for the "Next" button.
    You ask the question "What goes here"? Well what do you think goes there?
    If you are looking at item 1 and you press the "Next" button do you not want to look at item 2?
    So the obvious solution would be to add 1 to the previous item value. Does that not make sense? What problem do you have when you try that code?????
    Next you say "Is this right"? Well how are we supposed to know? You wrote the code. We don't know what the code is supposed to do. Again you try it. If it doesn't work then describe the problem you are having. I for one can't execute your code because I don't use JDK5. So looking at the code it looks reasonable, but I can't tell by looking at it what is wrong. Only you can add debug statements in the code to see whats happening.
    If you want help learn to as a proper question and doen't expect us to spoon feed the code to you. This is your assignment, not ours. We are under no obligation to debug and write the code for you. The sooner you learn that, the more help you will receive.

  • Seeking help with GREP expression

    I am working with InDesign's GREP feature for the first time. I'm learning the codes but I'm still pretty lost. I'd appreciate some assistance creating an expression.
    The document is a test. I'd like to reflow each question onto it's own page.
    The individual questions look more or less like this:
    LM_CC1234
    ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶
    Olenisquia dis etur rem quia dollenis maximus est?¶
    A»plicius perovit¶
    B»alit ducit fugia¶
    C»vel invel ius¶
    D»offic tem aboriae¶
    I'm open to different possibilities, but right now I'm trying to search for the spot that's either 11 or 12 characters (including line breaks) before the square dingbat (hexadecimal x25A0). The LM_CC1234 identifier sometimes uses a format with one more letter (like SLM_CC1224) hence the 11 or 12 character count.
    Once InDesign has found the spot, I want to insert a carriage return (hexadecimal xD) in that spot throughout the document.
    Thank you for your time!

    Hi,
    Did you consider startParagraph property to use?
    If      LM_CC1234
    or     LM_CC1234
            ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶
    are separate paragraphs -- this option could be set to StartParagraph.NEXT_PAGE,
    so no GREP needed here.
    hope...

  • Need help with iPhoto, Need help with iPhoto

    Hey there!!!
    When I plug in my iPhone I go to iPhoto and can choose to import the pictures. I also tried Image Capture as it seemed easier to organise my pictures, making folders, sub-folders, etc. The problem with this is everytime I plug my iPhone into the computer click on Import the system automatically makes second, third, fourth, etc copies of each picture. This also means that there is a copy of my pictures on iPhoto and on Image Capture - which I do not really need.
    I have tried to make Albums and Folders on iPhoto. Sometimes when I delete a picture as it has been saved in two albums it gets deleted from both albums. Why is this? How can I make Albums or Folders to organise my pictures. If my pictures are transferred directly onto iPhoto, can I find them anywhere else in my computer? If I wanted to burn pictures from various albums on a disc how could I do that on iPhoto? Also I dont want events to create themselves. How can I avoid this?
    I would like help with either using iPhoto or know how the stop the duplicating of pictures on Image Capture.
    Maybe there is a better way I can transfer the pictures onto my MacBook??
    Thanks a mil!!!

    Are you running a "referenced" or "managed' library?
    Image Capture does not store phortos in it. It's an application for uploading photos to wherever you tell it to, either a folder on the hard drive or into iPhoto. If you want to use only Image Capture to upload your photos to iPhoto then set iPhoto's General preferences to the following:
    Deleting Photos from an iPhoto Library:
    1 - from an Event or the Photos mode: select the photo(s) and use the Delete key to move the photos to the trash bin. Then empty the iPhoto Trash bin as follows:
    2 - from an album, smart album, book, slideshow, card, etc.: select the photo(s) and use the key combination of Command+Option+Delete to move the photos to the trash bin.  Then empty the trash bin as above.
    NOTE: deleting a photo from an album, slideshow, book, etc., with only the Delete key only deletes that photo from that item. Deleting a photo from an Event deletes ALL occurances of that photo in the library.
    OT

  • Need some help with GREP expressions

    I know--KNOW--there's a way to do this, but my GREP expressions keep failing.
    I want to add an em dash before any phrase that's in a paragraph style. So I obviously want the em dash to be in the location "beginning of paragraph." All my GREP searches keep failing. Can someone help?

    Adobe's implementation of "beginning of paragraph" is a tiny bit off from standard GREP (which, in itself, is less a set of hard & fast rules, but more like "guidelines"). Yes -- you can search for beginning of paragraph using plain ^, but you cannot use it with a replace operation.
    The trick is to give InDesign something to look for. Search for
    ^.
    (that's right -- one wildcard right after the start of a paragraph). You don't want to loose the character it finds, so replace with
    ~_$0
    where the first 2 codes is your em dash and the last 2 are "the entire found text". That's your original wildcard-found character!
    Don't forget to put your paragraph style in the Find Formatting box.
    This workaround works around the implementation failure, because you indeed want to add something to existing text. Unfortunately, another fairly standard GREP to look for empty paragraphs -- ^$ -- doesn't work, because then you have no place for a wildcard character ... (and yes, you can use a hard return \r instead of either first or last code, but then it won't work at beginning or end of story). It's one of those things I hope to see corrected with CS5.
    [Edit] Ha! Peter beat me to it but he made a typo. Besides, my story is longer.

  • I need help with GREP

    Dear Forum,
    I can't seem to figure out how the GREP-Search in InDesign is working.
    I have a document with 60 pages with a large number of incorrectly formatted prices. The false expressions are for example:
    EUR 250.000,00
    EUR 2.000,00
    EUR 15,00
    and so on with every possible value
    But they should be formatted as:
    250.000 Euro
    2.000 Euro
    15 Euro
    What do I have to tell GREP-Search in oder to format them correctly?
    Thanks a lot for your help,
    Ralf

    Vamitul, it's not unusual that there are things that can go wrong. But both our suggstions work correctly on the specified list -- and Ralf did not say what should happen when there is a number in cents, so it seems he wants to throw them away.
    If not: here is a single GREP that will move the EUR to the back and discard only ",00" cent values; other cents are preserved.
    \bEUR *([\d.]+(,\d\d\b(?<!,00))?)(,00\b)?
    replacing again with
    $1 Eur
    The result:
    EUR 250.000 -> 250.000 Eur
    EUR 250.000,00 -> 250.000 Eur
    EUR 2.000,01 -> 2.000,01 Eur
    EUR 15,05 -> 15,05 Eur

  • Need help with GREP query-Extract

    Hi folks,
    I'm trying to tighten up a GREP query I was able to piece together.
    This Find string allows me to find text within the <ex> tags and delete the tags themselves. The Change field then applies my Extract paragraph style.
    (?s)(<ex> *)(.+?)( *</ex>)
    What I need it to do is add a blank line above and below the extract. Can that be added to the string?
    TIA

    Yes, by changing to \r$2\r
    BUT, is this text already a paragraph? If it is, it would be better to add space before and after as part of the style. If it's not, I'm not sure that adding the returns in the same operation isn't going to change the text from which it is extracted as well, so you might want to search first for <ex>.+?</ex> and change to \r$0\r without changing the formatting, then run what you have now to change the format on the extract.

  • Help with scripting: need to import Excel files into PS type layers

    Howdy all,
    I have a series of TV commercials provided to me as layered PS files.  I work in CS3 and export to Avid for editing.
    For customization, I need to import their Excel list of phone numbers and duplicate each one into a type layer with existing efx and placement.
    There are 30-60 #s, which appear in 2 locations, so automation is key (just finished a 45 # series, and they have more!)
    I dont know how to script this, and would appreciate any guidance. I am not asking for someone to do it for me, just help me learn what I have to do.
    Dave Koslow

    From Excel save your file out as either CSV or TDT from the drop down 'save as' options. Once you have a plain text file script will be able to read the text file using which ever delimiter best suits you and create an array of string variables that you can use within photoshop to assign to the contents of a text layer…

  • Help with constuctor, need to rewrite program with this constructor

    i need to use this constructor for my Scholar class:
    public Scholar(String fullName, double gradePointAverage, int essayScore, boolean scienceMajor){here is the project that i'm doing:
    http://www.cs.utsa.edu/~javalab/cs17.../project1.html
    here's my code for the Scholar class:package project1;
    import java.util.*;
    public class Scholar implements Comparable {
        private static Random rand;
        private String fullName;
        private double gradePointAverage;
        private int essayScore;
        private int creditHours;
        private boolean scienceMajor;
        private String lastName;
        private String firstName;
        private double totalScore;
        /** Creates a new instance of Scholar */
            public Scholar(String lastName, String firstName){
                    this.fullName = lastName + ", " + firstName;
                    this.gradePointAverage = gradePointAverage;
                    this.essayScore = essayScore;
                    this.creditHours = creditHours;
                    this.scienceMajor = scienceMajor;
                    this.rand = new Random();
            public String getFullName(){
                return fullName;
            public double getGradePointAverage(){
                return gradePointAverage;
            public int getEssayScore(){
                return essayScore;
            public int getCreditHours(){
                return creditHours;
            public boolean getScienceMajor(){
                return scienceMajor;
            public String setFullName(String lastName, String firstName){
               fullName = lastName + ", " + firstName;
               return fullName;
            public double setGradePointAverage(double a){
                gradePointAverage = a;
                return gradePointAverage;
            public int setEssayScore(int a){
                essayScore = a;
                return essayScore;
            public int setCreditHours(int a){
                creditHours = a;
                return creditHours;
            public boolean setScienceMajor(boolean a){
                scienceMajor = a;
                return scienceMajor;
            public void scholarship(){
                Random doubleGrade = new Random ();
                Random intGrade = new Random ();
                gradePointAverage = doubleGrade.nextDouble() + intGrade.nextInt(4);
                Random score = new Random();
                essayScore = score.nextInt(6);
                Random hours = new Random();
                creditHours = hours.nextInt(137);
                Random major = new Random();
                int num1 = major.nextInt(3);
                if (num1 == 0)
                    scienceMajor = true;
                else
                    scienceMajor = false;
            public double getScore(){
                totalScore = (gradePointAverage*5) + essayScore;
                if (scienceMajor == true)
                    totalScore += .5;
                if (creditHours >= 60 && creditHours <90)
                    totalScore += .5;
                else if (creditHours >= 90)
                    totalScore += .75;
                return totalScore;
            public int compareTo(Object obj){
                Scholar otherObj = (Scholar)obj;
                double result = getScore() - otherObj.getScore();
                if (result > 0)
                    return 1;
                else if (result < 0)
                    return -1;
                return 0;
            public static Scholar max(Scholar s1, Scholar s2){
                if (s1.getScore() > s2.getScore())
                    System.out.println(s1.getFullName() + " scored higher than " +
                            s2.getFullName() + ".\n");
                else
                    System.out.println(s2.getFullName() + " scored higher than " +
                            s1.getFullName() + ".\n");
                return null;
            public static Scholar max(Scholar s1, Scholar s2, Scholar s3){
                if (s1.getScore() > s2.getScore() && s1.getScore() > s3.getScore())
                    System.out.println(s1.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s2.getScore() > s1.getScore() && s2.getScore() > s3.getScore())
                    System.out.println(s2.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s3.getScore() > s2.getScore() && s3.getScore() > s1.getScore())
                    System.out.println(s3.getFullName() + " scored the highest" +
                            " out of all three students.");
                return null;
            public String toString(){
                return  "Student name: " + fullName + " -" + " Grade Point Average: "
                        + gradePointAverage  + ". " + "Essay Score: " + essayScore + "."
                        + " Credit Hours: " + creditHours + ". "  +  " Science major: "
                        + scienceMajor + ".";
    }here's my code for the ScholarTester class:package project1;
    import java.util.*;
    public class ScholarTester {
    public static void main(String [] args){
    System.out.println("This program was written by Kevin Brown. \n");
    System.out.println("--------Part 1--------\n");
    Scholar abraham = new Scholar("Lincoln", "Abraham");
    abraham.scholarship();
    System.out.println(abraham);
    /*kevin.setEssayScore(5);
    kevin.setGradePointAverage(4.0);
    kevin.setCreditHours(100);
    kevin.setFullName("Brown", "Kevin J");
    kevin.setScienceMajor(true);
    System.out.println(kevin);*/
    Scholar george = new Scholar("Bush", "George");
    george.scholarship();
    System.out.println(george + "\n");
    System.out.println("--------Part 2--------\n");
    System.out.println(abraham.getFullName() + abraham.getScore() + ".");
    System.out.println(george.getFullName() + george.getScore() + ".\n");
    System.out.println("--------Part 3--------\n");
    if(abraham.compareTo(george) == 1)
        System.out.println(abraham.getFullName() + " scored higher than " +
                abraham.getFullName() + ".\n");
    else
        System.out.println(abraham.getFullName() + " scored higher than " +
                abraham.getFullName() + ".\n");
    System.out.println("--------Part 4--------\n");
        Scholar.max(abraham, george);
        Scholar thomas = new Scholar("Jefferson", "Thomas");
        thomas.scholarship();
            System.out.println("New student added - " + thomas + "\n");
            System.out.println(abraham.getFullName() + " scored " +
                    abraham.getScore() + ".");
            System.out.println(george.getFullName() + " scored " +
                    george.getScore() + ".");
            System.out.println(thomas.getFullName() + " scored " +
                    thomas.getScore() + ".\n");
        Scholar.max(abraham, george, thomas);
    }everything runs like it should and the program is doing fine, i just need to change the format of the Scholar constructor and probably other things. Can someone please give me an idea how to fix this.
    Thanks for taking your time reading this.

    then don't reply if you're not going to read it, i
    just gave the url, Don't get snitty. I'm just informing you that most people here don't want to click a link and read your whole bloody assignment. If you want help, the burden is on you to make it as easy as possible for people to help you. I was only trying to inform you about what's more likely to get you help. If doing things your way is more important to you than increasing your chances of being helped, that's your prerogative.
    so you can get an idea on what
    it's about, and yeah i know how to add a constructor,
    that's very obvious, That's what I thought, but you seemed to be saying, "How do I add this c'tor?" That's why I was asking for clarification about what specific trouble you're having.
    i just want to know how to
    implement everything correctly, so don't start
    flaming people. I wasn't flaming you in the least. I was informing you of how to improve your chances of getting helped, and asking for clarification about what you're having trouble with.

  • More help with Skillbuilders' Modal Page Plugin

    I have an employee page with a series of smaller report regions showing things like contact addresses, job roles, etc. All are form-on-a-table+report type of setup I would like to convert to modal pages. The popup is now working (thanks to a security setting pointed out by Dan), but on all of these forms, I would like to populate the P(X)_EMP_ID item from the parent to save the users an obvious step. I've tried putting it in the URL called by the Dynamic Action and I've tried setting the item value in the modal dialog to be the parent's correlated item, but neither seems to work like it would in a standard form page call where I just list the items to pass and their values. I must be doing something wrong here, but I can't quite place it. Can someone point me at what I'm missing?
    Here's the URL I'm trying to use:
    f?p=&APP_ID.:287:&APP_SESSION.:::287::P287_EMP_ID:&P281_EMP_ID.
    where 281 is the parent page and 287 is the modal page.
    I also tried setting up an additional TRUE action associated with the Dynamic Action to assign the page item value - that didn't seem to work either. BTW - I'm strictly dealing with the CREATE button ATM. I'll get to the edit links after I get this working.

    Does your page 281 have an employee id item?
    Yes. The respective items are P281_EMP_ID and P287_EMP_ID. There is also P282_EMP_ID, P283_EMP_ID, etc.
    Even if it did it wouldn't make sense to transfer it's value to your form page if you wanted to arrive at the form page in a create mode.
    In this case it does, however. I start out on a general listing (Interactive Report) of all the employees where each has an edit link to the "master" record for the employee containing employee ID, name, etc. There are several (5+) child tables to the master, however, which contain things like addresses, contacts, etc. Each has a one-to-many relationship with the employee master record. I am attempting to display these each in their own regions and this was working fine as standard form+report on a table with the report showing along with the master employee record.
    As such, though the Employee ID acts as the foreign key to the master record, that value is predetermined by virtue of the currently displayed employee master record - thus the desire to have this value propagate down to the modal window/form page. The users also want it because they get distracted and frequently forget who they are working on. They want the name of the employee listed here, and this is difficult to display without the ID to reference.
    To arrive at page 287 in a create mode you need to clear out the value of the primary key item on that page. See the following to learn more about URL syntax:
    http://docs.oracle.com/cd/E2390301/doc/doc.41/e21674/concept_url.htm#BEIFCDGF_
    Thanks. I looked that over and tried to make sure things were in the right place, but I'm pretty sure the issue is the automatic fetch. Once I wrote my own form population process to replace the existing one, it seemed to work fine and the URL syntax passed the value as desired.

  • NEED HELP WITH QUERY, NEED NEWEST RECORD ONLY

    Hi all,
    Here goes,
    I have an assingment in which i need to find the agents who allow the footballers to break the rules.
    So far i have 41 results, in which there is 4 agents and 24 footballers, and the same footballer has broken more than one rule or the rule more than once.
    What i now need is to arrange so that each footballer on shows up once no matter how many times they have broken the rules.
    i have
    SELECT
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    FROM
    agents a, transfers t, footballers f, footballers_fees fo
    WHERE
    a.agent_id = t.broker_id
    AND
    t.footballer_id = f.footballer_id
    AND
    f.footballer_id = fo.footballer_id
    AND
    (RULE 1 BROKEN AND RULE 2 BROKEN
    OR
    RULE 1 BROKEN AND RULE 2 NOT BROKEN
    OR
    RULE 1 NOT BROKEN AND RULE 2 BROKEN)
    GROUP BY
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    ORDER BY
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    (I havent typed out the SQL for the rules 1 and 2 but i know it works)
    Now i need to show only each footballer once whether they have broken either rule and more than once or not.
    I have been staring at the screen for near enough 10 hours and any help or ideas would be greatly appreciated
    Thanks all :)

    884080 wrote:
    Hi all,
    Here goes,
    I have an assingment in which i need to find the agents who allow the footballers to break the rules.
    So far i have 41 results, in which there is 4 agents and 24 footballers, and the same footballer has broken more than one rule or the rule more than once.
    What i now need is to arrange so that each footballer on shows up once no matter how many times they have broken the rules.
    i have
    SELECT
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    FROM
    agents a, transfers t, footballers f, footballers_fees fo
    WHERE
    a.agent_id = t.broker_id
    AND
    t.footballer_id = f.footballer_id
    AND
    f.footballer_id = fo.footballer_id
    AND
    (RULE 1 BROKEN AND RULE 2 BROKEN
    OR
    RULE 1 BROKEN AND RULE 2 NOT BROKEN
    OR
    RULE 1 NOT BROKEN AND RULE 2 BROKEN)
    GROUP BY
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    ORDER BY
    t.transfer_time || ' ' || a.first_name || ' ' || a.last_name || ' ' || f.first_name || ' ' || f.last_name || ' ' || f.footballer_id || ' ' || t.transfer_id
    (I havent typed out the SQL for the rules 1 and 2 but i know it works)
    Now i need to show only each footballer once whether they have broken either rule and more than once or not.
    I have been staring at the screen for near enough 10 hours and any help or ideas would be greatly appreciated
    Thanks all :)Realize that we don't have your tables or data, so we can't run, test, or improve your SQL.
    so what exactly do you expect from us?

  • Help with JTable needed

    Hi guys. How to update a JTable? What am I doing wrong? When I press buttons nothing happend d:(
    public void init() {
            this.setSize(640,420);
            //this.setLayout ( null );
            panel = new JPanel();
            //Builder.buildInsertGui();
            //Builder.buildInfoGui();
            //Builder.buildSettingsGui();
            Builder.table=Database.getOperations(); 
            ActionListener ladd = new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        Builder.table=new JTable();
                        System.out.println("free");
                        Application.panel.repaint();
              JButton badd = new JButton("Free");
              badd.addActionListener(ladd);
              ActionListener ldel = new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        Builder.table=Database.getOperations();
                        System.out.println("fill");
                        Application.panel.repaint();
              JButton bdel = new JButton("Fill");
              badd.addActionListener(ldel);
              this.panel.add(Builder.table);
              this.panel.add(bdel);
              this.panel.add(badd);
              this.add(panel);
       }

    Hi,
    first create the table once in the init method
    second you don't need to call the repaint on the JPanel each time you do the action
    third you need to update your table via the table Model by extending the AbstractTableModel
    The table Model is the part which hold the data for the table to be presented
    fourth get the table Model; then populate it again with different values
    Fifth call table.repaint;
    ex:
    public class MyStocksTable extends JFrame {
      protected JTable m_table;
      protected StockTableData m_data;
      protected JLabel m_title;
      protected JButton m_btn;
      public MyStocksTable() {
        super("Stocks Table");
        setSize(600, 300);
         UIManager.put("Table.focusCellHighlightBorder",
              new LineBorder(Color.black, 0));
        m_data = new StockTableData();
        m_title = new JLabel(m_data.getTitle(),
          new ImageIcon("money.gif"), SwingConstants.CENTER); 
        m_title.setFont(new Font("Helvetica",Font.PLAIN,24));
        getContentPane().add(m_title, BorderLayout.NORTH);
        m_table = new JTable();
        m_table.setAutoCreateColumnsFromModel(false);
        m_table.setModel(m_data);
        m_btn = new JButton("UPDATE ME");
        getContentPane().add(m_btn,BorderLayout.SOUTH);
        m_btn.addActionListener(new MyActionListener(m_table));
        for (int k = 0; k < m_data.getColumnCount(); k++) {
          DefaultTableCellRenderer renderer = new
            DefaultTableCellRenderer();
          renderer.setHorizontalAlignment(
            StockTableData.m_columns[k].m_alignment);
          TableColumn column = new TableColumn(k,
          StockTableData.m_columns[k].m_width, renderer, null);
          m_table.addColumn(column);
        JTableHeader header = m_table.getTableHeader();
        header.setUpdateTableInRealTime(false);
        JScrollPane ps = new JScrollPane();
        ps.getViewport().setBackground(m_table.getBackground());
        ps.getViewport().add(m_table);
        getContentPane().add(ps, BorderLayout.CENTER);
      public static void main(String argv[]) {
         MyStocksTable frame = new MyStocksTable();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setVisible(true);
    class MyActionListener  implements ActionListener {
          private JTable table;
          public MyActionListener(JTable table){
               this.table = table;
          public void actionPerformed(ActionEvent e) {
          StockTableData dataModel = (StockTableData)table.getModel();
          dataModel.setDefaultData2();
          table.setModel(dataModel);
          table.repaint();
    class StockData {
      public String  m_symbol;
      public String  m_name;
      public Double  m_last;
      public Double  m_open;
      public Double  m_change;
      public Double  m_changePr;
      public Long    m_volume;
      public StockData(String symbol, String name, double last,
       double open, double change, double changePr, long volume) {
        m_symbol = symbol;
        m_name = name;
        m_last = new Double(last);
        m_open = new Double(open);
        m_change = new Double(change);
        m_changePr = new Double(changePr);
        m_volume = new Long(volume);
    class ColumnData {
      public String  m_title;
      public int     m_width;
      public int     m_alignment;
      public ColumnData(String title, int width, int alignment) {
        m_title = title;
        m_width = width;
        m_alignment = alignment;
    class StockTableData extends AbstractTableModel {
      static final public ColumnData m_columns[] = {
        new ColumnData( "Symbol", 100, JLabel.LEFT ),
        new ColumnData( "Name", 160, JLabel.LEFT ),
        new ColumnData( "Last", 100, JLabel.RIGHT ),
        new ColumnData( "Open", 100, JLabel.RIGHT ),
        new ColumnData( "Change", 100, JLabel.RIGHT ),
        new ColumnData( "Change %", 100, JLabel.RIGHT ),
        new ColumnData( "Volume", 100, JLabel.RIGHT )
      protected SimpleDateFormat m_frm;
      protected Vector m_vector;
      protected Date   m_date;
      public StockTableData() {
        m_frm = new SimpleDateFormat("MM/dd/yyyy");
        m_vector = new Vector();
        setDefaultData();
      public void setDefaultData() {
        try {
          m_date = m_frm.parse("12/18/2004");
        catch (java.text.ParseException ex) {
          m_date = null;
        m_vector.removeAllElements();
        m_vector.addElement(new StockData("ORCL", "Oracle Corp.",
          23.6875, 25.375, -1.6875, -6.42, 24976600));
        m_vector.addElement(new StockData("EGGS", "Egghead.com",
          17.25, 17.4375, -0.1875, -1.43, 2146400));
        m_vector.addElement(new StockData("T", "AT&T",
          65.1875, 66, -0.8125, -0.10, 554000));
        m_vector.addElement(new StockData("LU", "Lucent Technology",
          64.625, 59.9375, 4.6875, 9.65, 29856300));
        m_vector.addElement(new StockData("FON", "Sprint",
          104.5625, 106.375, -1.8125, -1.82, 1135100));
        m_vector.addElement(new StockData("ENML", "Enamelon Inc.",
          4.875, 5, -0.125, 0, 35900));
        m_vector.addElement(new StockData("CPQ", "Compaq Computers",
          30.875, 31.25, -0.375, -2.18, 11853900));
        m_vector.addElement(new StockData("MSFT", "Microsoft Corp.",
          94.0625, 95.1875, -1.125, -0.92, 19836900));
        m_vector.addElement(new StockData("DELL", "Dell Computers",
          46.1875, 44.5, 1.6875, 6.24, 47310000));
        m_vector.addElement(new StockData("SUNW", "Sun Microsystems",
          140.625, 130.9375, 10, 10.625, 17734600));
        m_vector.addElement(new StockData("IBM", "Intl. Bus. Machines",
          183, 183.125, -0.125, -0.51, 4371400));
        m_vector.addElement(new StockData("HWP", "Hewlett-Packard",
          70, 71.0625, -1.4375, -2.01, 2410700));
        m_vector.addElement(new StockData("UIS", "Unisys Corp.",
          28.25, 29, -0.75, -2.59, 2576200));
        m_vector.addElement(new StockData("SNE", "Sony Corp.",
          96.1875, 95.625, 1.125, 1.18, 330600));
        m_vector.addElement(new StockData("NOVL", "Novell Inc.",
          24.0625, 24.375, -0.3125, -3.02, 6047900));
        m_vector.addElement(new StockData("HIT", "Hitachi, Ltd.",
          78.5, 77.625, 0.875, 1.12, 49400));
      public void setDefaultData2() {
             try {
               m_date = m_frm.parse("12/18/2004");
             catch (java.text.ParseException ex) {
               m_date = null;
             m_vector.removeAllElements();
             m_vector.addElement(new StockData("ORCLAlan", "Oracle Corp.",
               23.6875, 25.375, -1.6875, -6.42, 24976600));
             m_vector.addElement(new StockData("EGGSAlan", "Egghead.com",
               17.25, 17.4375, -0.1875, -1.43, 2146400));
             m_vector.addElement(new StockData("TAlan", "AT&T",
               65.1875, 66, -0.8125, -0.10, 554000));
             m_vector.addElement(new StockData("LU", "Lucent Technology",
               64.625, 59.9375, 4.6875, 9.65, 29856300));
      public int getRowCount() {
        return m_vector==null ? 0 : m_vector.size();
      public int getColumnCount() {
        return m_columns.length;
      public String getColumnName(int column) {
        return m_columns[column].m_title;
      public boolean isCellEditable(int nRow, int nCol) {
        return false;
      public Object getValueAt(int nRow, int nCol) {
        if (nRow < 0 || nRow>=getRowCount())
          return "";
        StockData row = (StockData)m_vector.elementAt(nRow);
        switch (nCol) {
          case 0: return row.m_symbol;
          case 1: return row.m_name;
          case 2: return row.m_last;
          case 3: return row.m_open;
          case 4: return row.m_change;
          case 5: return row.m_changePr;
          case 6: return row.m_volume;
        return "";
      public String getTitle() {
        if (m_date==null)
          return "Stock Quotes";
        return "Stock Quotes at "+m_frm.format(m_date);
    }I hope this could help
    Regard,
    Alan Mehio
    London,UK

  • A little more help with image

    I have refered to this thread to help me create my background image.
    http://forum.java.sun.com/thread.jspa?threadID=599393&messageID=3196643
    However I am stuck mostly because of not really fully grasping all the objects and how they work yet.
    Basically right now I have a JFrame and then I have a container which I put all my objects in.
    First question:
    What exactly does the following line of code do?
    Container contentPane = getContentPane();
    Does the "getContentPane()" method get the JFrame, since this is the class this line of code is embedded in?
    It sets contentPane which is a container to the JFrame?
    Second question...
    So using the above link I created a class called BackgroundImage and it works ...sort of. I have two windows - one is my JFrame game and the other is this background frame.
    Now I knew this would happen and I realize what I am supposed to do but I have been unsuccessful. Basically I need to make this JPanel my contentPane right?
    But when I say something like
    JPanel contentPane = panel my JFrame has nothing in it...
    How do I take this seperate window and incorporate it into what I already have.
    I want to use the contentPane variable since this is the variable where everything gets added throughout the code? I can't seem to get the JPanel to work.
    Take a look at some code snippets:
    public class DungMast extends JFrame
        /** Creates a new instance of EventPress */
        public DungMast() {
            Animation_Complete=false;
            Current_Level = 1;
            Level_Complete = false;
            CreateUserInterface();
            JPanel panel = new JPanel()
            protected void paintComponent(Graphics g)
           //  Dispaly image at at full size
         g.drawImage(img_BG.getImage(), 0, 0, null);
         //  Scale image to size of component
    //                    Dimension d = getSize();
    //                    g.drawImage icon.getImage(), 0, 0, d.width, d.height, null);
                        //  Fix the image position in the scroll pane
    //                    Point p = scrollPane.getViewport().getViewPosition();
    //                    g.drawImage(icon.getImage(), p.x, p.y, null);
                        super.paintComponent(g);
             panel.setOpaque( false );
             panel.setPreferredSize( new Dimension(400, 400) );
             scrollPane = new JScrollPane( panel );
             getContentPane().add( scrollPane );
             JButton button = new JButton( "Hello" );
             panel.add( button );
        }  //end constructor for main JFrame
    //Then I have something like
    JPanel contentPane = panel;
    }

    What exactly does the following line of code do?
    Container contentPane = getContentPane();
    It gets the content pane for the JFrame and saves a reference to it for later use, viz,
    the reference "contentPane" can be used to call methods in the Container class.
    Lightweight (Swing) top&#8211;level containers have a content pane that holds the child
    components for the parent container. See the comments section of the JRootPane class api
    for a birds&#8211;eye view.
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class BackgroundImage {
        private JPanel getContent(BufferedImage image) {
            // Make up our own content pane with an image
            // in the background.
            ContentPanel cp = new ContentPanel(image);
            // Add some components.
            cp.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.weighty = 1.0;
            for(int j = 0; j < 10; j++) {
                gbc.gridwidth = (j+1)%3 == 0 ? gbc.REMAINDER : 1;
                cp.add(new JButton(String.valueOf(j+1)), gbc);
            return cp;
        public static void main(String[] args) throws IOException {
            BufferedImage image = ImageIO.read(new File("images/cougar.jpg"));
            BackgroundImage test = new BackgroundImage();
            JFrame f = new JFrame();
            System.out.println("Default contentPane = " +
                                f.getContentPane().getClass().getName());
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(test.getContent(image));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ContentPanel extends JPanel {
        BufferedImage image;
        public ContentPanel(BufferedImage image) {
            this.image = image;
            // This is required for JComponents that are used
            // as content panes since the Ocean LookAndFeel
            // (which can have non-opaque panels) was introduced.
            // Content panes must be opaque so they can draw
            // themseves and their child components.
            setOpaque(true);
            System.out.println("Default layout manager = " +
                                getLayout().getClass().getName());
        protected void paintComponent(Graphics g) {
            // Fill background with opaque color.
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            int x = (w - image.getWidth())/2;
            int y = (h - image.getHeight())/2;
            g.drawImage(image, x, y, this);
    }

  • Mac newbie-help with iphoto needed

    Just made the switch from windows to the the new macbook and having a little trouble with something. On my old win xp system I kept a folder on my desktop called 'online images'. I work in fashion design and kept any fashion related images that I saw online in it, right clicking and saving to this folder as I went along, it became a useful reference and one I was continually adding to.
    Now I'm on the mac, I transferred the 'online images' folder over, it's now stored in my Iphoto library and looks fantastic. However, now, as I search the web on my shiny new macbook and find images I want to save things seem a little more tricky.
    Basically, I want to be able to save an image from the web directly into my 'online images' folder in iphoto in the simplest way possible, is there any way to do it directly without having to fire up iphoto? I love being able to just drag an image from the web onto my desktop but it would be great if I could just throw it into my 'online images' event on iphoto without having to do it in several moves.
    Sorry for the long explanation, hope it makes sense, all suggestions welcome..
    Message was edited by: penk

    penk
    There's a ? icon on the lower right which is the Help, and there's a wealth of support available on the makers website. But the basics are:
    Folders Tab:
    Add your folder 'Test'. This is the folder the rules will work on
    Then in the right hand pane, click on the '+', a sheet descends to create the Rule:
    Name It
    Set it to ALL
    KIND -> IS -> PICTURE
    IMPORT TO iPHOTO -> to album -> etc.
    Then ok.
    Drop an image file into the 'Test' folder to see if it works.
    Regards
    TD

  • More help with visible and hidden fields

    Looking for the script that will let me click a button and then show hidden text fields.
    Here's what I want to do:
    I have a text field on my form that if another text field is needed, the user clicks the "Add another Case" button and the hidden text field will appear.

    Does anyone have any suggestions?  Thanks.
    Basically, I have several needs on this form:
    First,  I only want a text field to be visible if the Add New button is selected.  Otherwise I need the text field hidden.
    Secondly, I have several text fields where I need to allow for multiple entries of the same type of information.  Such as Party Information (which consists of name, address, city, state, etc.)  There will be more than one party, so I would need the form to record the first information for the party, then the user clicks Add Another Party......which then clears the previous information allowing for the user to enter the next party info, and so on.
    I'm sure this is all basic stuff, but as I said, I'm new to this and just need to be set in the right direction.  Not sure how to get you the form.
    Thanks a bunch

Maybe you are looking for

  • How to track a request id through an access policy in OIM

    lets say User-A requests a job role on behalf of User-B and this job role has a access policy attached to it, to provision the user to AD and SAP. Now we want an email sent to user-A (i.e the user-A who is responsible for job role assignment which ma

  • Problem during deployment of axis (stock) examples

    Hi all I am getting problem during the deployment of stock example given in the apache site. Even i am not getting the right response from the URL http://localhost:8080/axis/services/Version?method=getVersion and http://localhost:8080/axis/EchoHeader

  • Java engine problem

    Hello all, i have a problem with the Java SP 18 and I welcome any answer on this problem. Description: OS: Windows 2003 R2 x64 DB: Oracle 10.2.0.2 x64 On this server already is installed Solution Manager 4.0 and  a mySAP ERP 2004 system with Java add

  • Two memberships now!

    Creative Cloud payment didn't go through due to bank card cancellation (fraudulent activity reported on card). Updated the account to new card info from bank. Payment was never run again. Adobe cancelled my membership even though it had the new corre

  • When will Firefox update the pdf plugin for version 4? This is a major technical oversight which required me to downgrade back to 3.

    The PDF plugin which worked great prior to v 4 of FF needs to be updated. I am sure people are aware of this but doesn't seem to be any comments on when this can be resolved.