How can i make hidden column in JTable

hi, how can i make hidden column in JTable,
basically i have a ID field in JTable, i have to use this ID , but i also dont want to show this ID in JTable.
any idea how ??

staiji its not working
i did this :
first :
TableColumnModel columnModel =
usersTable.getColumnModel();TableColumn column =
columnModel.getColumn(1);
usersTable.removeColumn(column);
then when i trying to get this :
Integer userId =
(Integer)usersTable.getValueAt(UserBrowser.this.usersTa
le.getSelectedRow(), 0);
it not give me ID column's value .
i have a column in JTable like :
ID | Username | First name | Last name
i want to hide ID column , but get this ID's value
when user clicks on JTable row.Hi, if you would read the documentation about JTable.getValueAt(...) you will find, that there is a significant difference between this method and the datamodels getValueAt(...) method. JTables getValueAt(...) method interprets column-index as index in its TableColumnModel - in your TableColumnModel there is no column any longer that holds ID values, therefore you were not able to get it by JTable.getValueAt(...). Do not use these methods for the purpose you want it for - you will also get the wrong values, if the user has repositioned columns - the column index is always interpreted as index in the currently used TableColumnModel and IS NOT A MODELINDEX.
greetings Marsian

Similar Messages

  • How can I make a column of sums out of a repeating pattern of 24 changing numbers

    How can I make a column of sums out of a repeating pattern of 24 changing numbers in Numbers.
    I have a long list of 8760 numbers of which I need to take the sum (and store in a column) of each 24 numbers.

    Here's one way. I've reduced the example, taking groups of five numbers from a set of 20. I've used 3 as the data number in all cases to make the sum easily recognizable.
    Original column of numbers in Data::column A.
    Data::B2 (and filled down): =QUOTIENT(ROW()+3,5)
    This adds 3 to the row number, then divides by 5, returning the quotient and ignoring the remainder.
    The result is a 'group number' for each group of five rows.
    Sums of each group are reported in the Sums table.
    Sums::A2 (and filled down): =ROW()-1
    Sums::B2 (anf filled down): =SUMIF(Data::$B,A2,Data::$A)
    For your example, assuming the 8760 numbers are listed in column A of a table named Data, starting at cell A2:
    Add a second column to the table (column B).
    In B2 enter the QUOTIENT formula above, with these two revisions:
    =QUOTIENT(ROW()+22,24)
    Fill down to all cells in the column.
    Provided you have named the first table "Data", both formulas in the Sums table will be as written above. You will need to extend the Sums table to 366 rows (including the Header row) to accommodate all 365 groups of 24.
    Regards,
    Barry
    PS: For details on the functions used, see the iWork Formulas and Functions User Guide. You can download the guide via the Help menu in Numbers '09.

  • How can I make a column of sums of the column next to it up to the row each sum is on?

    Hi Forum,
    I would like to find a fast way to do this:
    Numbers
    Sums
    1
    1 [sum of cell 1]
    2
    3 [sum of cells 1 and 2]
    3
    6 [sum of cells 1 through 3]
    4
    10 [sum of cells 1 through 4]
    5
    15 [sum of cells 1 through5]
    6
    21 [sum of cells 1 through 6]
    7
    28 [sum of cells 1 through 7]
    8
    36 [sum of cells 1 through 8]
    9
    45 [sum of cells 1 through 9]
    10
    55 [sum of cells 1 through 10]
    I have 500 cells.  I know how to do the SUM function one sum at a time, but I am hoping for an easier technique.
    Bruce

    the first thing to realize is that each sum is the sum of all the previous rows plus the row you are on.  This means that each row can simply add itself to the previous sum.
    row 1 is a special case because there is no row before it so B1 = A1.
    All other rows in B are:
    Bn = B(n-1) +An   (where n is the current row number)
    Wayne
    Message was edited by: Wayne Contello

  • How can I make Mobile column ?

    we here in Egypt have specific format for mobiles number ..... it's like that :-
    0129231239
    0109283746
    0168483873
    ect,.
    so .... I want create table with mobile column whither this column be ten numbers only no more no less , and first two numbers be (01)
    I did that code but didn't work !
    create table mob ( Mobile varchar2(10) check (length(mobile)='10' , substr(mobile,1,2)='01');
    what's the right code for what I need ?!
    and thanks in advance

    but I can't see what's the point from use it here ?!!! Well as said - the point is to refuse to insert characters:
    SQL> create table mob ( mobile varchar2(10) check (length(mobile)=10 and translate(mobile,'0123456789','01')='01'))
    Table created.
    SQL> insert into mob values ('0123456789')
    1 row created.
    SQL> insert into mob values ('01A3456789')
    insert into mob values ('01A3456789')
    Error at line 10
    ORA-02290: check constraint (MICHAEL.SYS_C0013702) violatedIsn't that what you wanted?
    Just realized: It is still not perfect. But I am sure you or someone else can modify accordingly in case ;)
    Message was edited by:
    michaels

  • How can I make two columns in DropDownList

    like this
    I remember that the solution met.
    Except alignment spaces in a text string.

    from the Documentation
    Creating multi-column lists
    In list controls (ListBox, DropDownList, TreeView), a set of ListItem objects represents the individual
    choices in the list. Each choice can be labeled with a localizable string, an image, or both, as specified by
    the text and image properties of the ListItem (see “Displaying images” on page 72).
    You can define a ListBox to have multiple columns, by specifying the numberOfColumns creation
    parameter. By default, the number of columns is 1. If you specify multiple columns, you can also use the
    creation parameters to specify whether headers are shown, and the header text for each column.
    If you specify more than one column, each ListItem object that you add to the box specifies one selectable
    row. The text and image of the ListItem object specifies the label in the first column, and the subitems
    property specifies labels that appear in that row for the remaining columns.
    The subitems value is an array, whose length is one less than the number of columns. That is, the first
    member, ListItem.subitems[0], specifies the label in the second column. Each member specifies one
    label, as a JavaScript object with two properties:
    { text : displayString , image : imageFileReference }
    For example, the following fragment defines a list box with two columns, and specifies the labels in each
    column for the two choices:
    // create list box with two titled columns
    var list = dlg.add ('ListBox', [0, 0, 150, 75], 'asd',
    {numberOfColumns: 2, showHeaders: true,
    columnTitles: ['First Name', 'Last Name']});
    // add an item for the first row, with the label value for the first column
    var item1 = list.add ('item', 'John');
    // add the label value for the second column in that row.
    item1.subItems[0].text = 'Doe';
    // add an item for the second row, with the text for the first column label
    var item2 = list.add ('item', 'Jane');
    // add the label text and image for the second column in the second row
    item2.subItems[0].text = 'Doe';
    item2.subItems[0].image = File ("~/Desktop/Step1.png");

  • How can i make custom column added to inbox sortable

    I had a requirement to add custom column to workflow inbox, i was able to achieve this without much difficulty.
    But i have noticed this custom column is not sortable, against the OOTB columns.
    Not sure what i am missing, Thanks in Advance
    in the json, i dont see any different between OOTB column values and custom column values
    startTime: 1359678539512,
    lifestage: "Approve",
    duedate: 1368769500000,
    Environment CQ 5.5

    Hi efish,
              I followed steps specified at below post. The column is sortable.
              http://forums.adobe.com/message/5032804#5032804
    Thanks,
    Sham

  • How can I Make one column into Multiple columns

    Id
    SCM-01-015
    SCM-01-020
    SFA-02-021
    SFC-02-042
    STB-03-035
    STP-04-167
    SVF-06-150
    I want the output like this
    Id 01 02 03 04 06
    SCM-01-015 5
    SCM-01-020 10
    SFA-02-021 15
    SFC-02-042 15
    STB-03-035 20
    STP-04-167 50
    SVF-06-150 5
    thank you in advance

    Hi,
    801668 wrote:
    Id
    SCM-01-015
    SCM-01-020
    SFA-02-021
    SFC-02-042
    STB-03-035
    STP-04-167
    SVF-06-150
    I want the output like this
    Id 01 02 03 04 06
    SCM-01-015 5
    SCM-01-020 10
    SFA-02-021 15
    SFC-02-042 15
    STB-03-035 20
    STP-04-167 50
    SVF-06-150 5
    thank you in advanceWhenever you post formatted text (such as query output) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after formatted text, to preserve spacing.
    Do you want output something like this, which is from the scott.emp table?ENAME ANALYST CLERK MANAGER PRESIDENT SALESMAN
    ALLEN 1600
    JONES 2975
    FORD 3000
    CLARK 2450
    MILLER 1300
    SMITH 800
    WARD 1250
    MARTIN 1250
    SCOTT 3000
    TURNER 1500
    ADAMS 1100
    BLAKE 2850
    KING 5000
    JAMES 950
    (ALLEN is a SALESMAN, JONES is a MANAGER, ..., JAMES is a CLERK.)
    If so, do a pivot, somehting like this:SELECT     ename
    ,     MIN (CASE WHEN job = 'ANALYST' THEN sal END)     AS analyst
    ,     MIN (CASE WHEN job = 'CLERK' THEN sal END)     AS clerk
    ,     MIN (CASE WHEN job = 'MANAGER' THEN sal END)     AS manager
    ,     MIN (CASE WHEN job = 'PRESIDENT' THEN sal END)     AS president
    ,     MIN (CASE WHEN job = 'SALESMAN' THEN sal END)     AS salesman
    FROM     scott.emp
    GROUP BY ename
    Always say which version of Oracle you're using.
    The query above will work in Oracle 8.1 or higher, but starting in Oracle 11 there's a better way:  SELECT ... PIVOT.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I make my query to compare only columns of two tables... not the storage information?

    11GR2
    =-----------------------------------
    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    begin
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY', TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'TABLESPACE',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'REF_CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS_AS_ALTER',FALSE);
    End;
    select REGEXP_REPLACE(dbms_metadata_diff.compare_alter('TABLE','TABLE_NAME_A','TABLE_NAME_A','USER1','USER2'),('USER1...'),'', 1, 0, 'i') from dual

    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    If you want help you have to SHOW us what you are doing and how you are doing it; you can't just try to tell us in your own words.
    We can't see your computer screen.

  • How can I make a detailed form widget into TWO columns?

    how can I make a detailed form widget into TWO columns? I have a contact form with a lot of fields.

    Hi Whatsmyjam9999,
    You can place a blank composition widget then click tigger 1, click inside target 1 and from menu--> files--> place the image and adjust it's dimensions, you can repeat the same steps for trigger 2 and 3
    Here is a video link http://ghai2.worldsecuresystems.com/jing/2013-07-22_1442.swf

  • How can i set the column width in the jtable?

    how can i set the column width in the jtable?
    can anybody send me a simple example??

    TableColumn column = table.getColumnModel().getColumn( columnIndex );
    column.setWidth( desiredColumnWidth);
    column.setMinWidth( desiredMinColumnWidth);
    column.setMaxWidth( desiredMaxColumnWidth);

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • How can I make a weekly 'to do' list?  I don't want the list associated with a particular date and time; just a list of things to get done!

    How can I make a weekly 'to do' list? I don't want it associated with a particular day or or time, just the week, preferably with the ability to check off or remove when done.

    Thank you for the excellent reference Peddi. I had played with the OAMessageChoiceBean component yesterday, but I was able to tell from your instructions that "Picklist Display Attribute" and "Picklist Value Attribute" really are not for binding to the database EO. That was the key piece of information that had me confused.
    In addition to adding the messageChoice component to the page, I needed to write some code to synchronize the picklist value with the corresponding code value, which I placed in am OAFormValueBean (hidden form field) which I could then bind to my application's database EO in the controller, running in the processFormRequest procedure:
    /** Synchronize the catalog code with the selected catalog name */
    protected void syncCatalogValues(OAPageContext pageContext,
    OAWebBean webBean, MyApplicationAMImpl am) {   
    OAMessageChoiceBean mcb =
    (OAMessageChoiceBean) webBean.findChildRecursive("CatalogName");
    OAFormValueBean cc =
    (OAFormValueBean) webBean.findChildRecursive("CatalogCode");
    String catalogDescription = mcb.getText(pageContext);
    if (catalogDescription != null) {
    String catalogCode = am.getCatalogCode(catalogDescription);
    cc.setValue(pageContext, catalogCode);
    Along with a little code to get the catalogCode value from the LOVVO, that's all it took.
    Thanks again. This was a great help.
    Pete

  • Pages:  How can I sort one column of words and not have it affect the other columns?

    How can I sort one column of words and not have it affect the other columns?  I have opened the inspector to the edit columns and rows under Table.  It will sort the column, but then it changes the other colums as well.  I know that if I use Numbers, it will work, but I want to know how to do the same thing in Pages.

    Hi Peter,
    Numbers sorts full rows on values in selected column(s). The technique for sorting a single column is essentially the same as Jerry is describing for Pages tables—separate the (data in the) column to be sorted, sort it, return it to the table.
    In Numbers the actual column may be separated from the original table, sorted, then returned. In Pages, the data must be extracted, sorted, then pasted back in, overwriting the unsorted data (if it was left in the original table).
    iWork tables follow a database model in which each row is a Record, and each column holds a Field within the records.
    As evidenced by the current question (and several similar questions arising in the Numbers community) that model doesn't apply to the way some users, especially some who come in from the MS Excel world, use tables.
    With Excels model—islands of data on a single large table, the ability to sort one or a selected few columns of data makes sense. One 'island' may comprise only cells AA21:AH50. Sorting that small 'table' should be possible without disturbing the rest of rows 21-30, which are probably part of one or more other 'data islands' in the sea that is a MS Excel spreadsheet.
    In Numbers, each of those 'islands' would be a separate Table, and that Table would be sortable without disturbing other Tables in the document.
    Regards,
    Barry

  • How can I make a form show complex composite data?

    How can I make a form show complex composite data?
    We would like a form to display the following information:
    Employee Names as the columns, 1 row for each calendar day, and each item in the block containing the total sales amount (and other information) for that employee for that day.
    This would require the block to function as a (composite) crosstab report.
    Here is an example:
    We have employees: Jane, John, Jim, and Janice
    We would like to see their total sales for the following days: 5/1 .. 5/5
    Jane John Jim Janice
    5/1 50 8 10 3 30 5 20 7
    5/2 40 7 60 8 10 2 30 4
    5/3 20 3 50 8 70 9 50 9
    5/4 51 8 40 7 40 8 50 8
    5/5 10 1 20 2 90 10 10 2
    We have a table with records of each day, for each employee, and their sales for that day.
    There is a possibility our list of employees can change as well as the number of days.
    Anyone tried doing anything like this with a form? We don't want to just embed a report because we would like to include other data as well besides what is mentioned above and we would like them to be able to change some of that data. Thanks in advance for any help.
    null

    I have a VERY similar problem where I want to have this matrix on the form with six days worth of data (three columns for each day) for my data table. I have done as Momen has suggested and created a view (using SQLPLUS):
    create table weekdays (weekday varchar2(3), date_x date);
    drop view employee_absences_v;
    create view employee_absences_v as
    select weekday,
    absence_date,
    hours,
    absence_code_lvid,
    adjustment_status_lvid
    from employee_absences ea, weekdays wd;
    that hopefully provides a row for each day of the week for my data table. The view is created OK but I'm not sure how to get it into the form properly. Also, I am using the form to CREATE rows in the data table not just SELECT and DISPLAY and there may or may not be a row of data for a corresponding day which is going to be a problem for me using this view method, I think. Let me know how this goes and if you get your form to work and how? Momen, your method appeals to me but it's not 100% clear how to get it to work in a form?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Tina Radosta ():
    We tried to create the view (not with Designer because we don't have that). We were not successful in creating a view with a matrix. We would greatly appreciate your help.
    Thanks in advance,
    Tina<HR></BLOCKQUOTE>
    null

  • How can i make the text go vertically in numbers

    How can I make the text vertical in numbers?  I have merged the cells and cannot find an option for making it go vertical as opposed to horizontal.

    I already gave two tools to fit this kind of needs.
    tip #1 :
    --{code}
    --[SCRIPT write_vertically]
    Enregistrer le script en tant que Script : write_vertically.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Saisir dans une cellule le mot à écrire verticalement puis le sélectionner.
    ATTENTION, il ne faut pas sélectionner la cellule mais le mot qui doit apparaitre surligné.
    Aller au menu Scripts , choisir Numbers puis choisir “write_vertically”
    Le script colle dans la cellule le mot apès avoir inséré un return entre tous les caractères.
    Pour mon usage personnel j'associe un raccourci à ce script grace à FastScripts.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: write_vertically.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    In a cell, type a word to write vertically then select it.
    CAUTION, don’t select the cell but the word which must be highlighted.
    Go to the Scripts Menu, choose Numbers, then choose “write_vertically”
    The script insert in the cell the word after inserting a return between every characters.
    For my own use, I link a shortcut to the script thank to FastScripts.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/12/17
    2012/01/01 no longer use a local variable, use result
    --=====
    on run
    Clear the clipboard *)
      set the clipboard to ""
    Copy the selection in the clipboard *)
              my raccourci("Numbers", "c", "c")
    Loop waiting that the clipboard is really filled *)
              repeat
                        try
                                  if (the clipboard as text) is not "" then exit repeat
                        on error
                        end try
              end repeat
    Extract the clipboard's content *)
      the clipboard as text
    Insert return between every characters *)
              my recolle(every character of result, return)
    Fill the clipboard with the edited string *)
      set the clipboard to result
    Paste in the cell *)
              my raccourci("Numbers", "v", "cas")
    end run
    --=====
    on recolle(l, d)
              local oTIDs, t
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set t to l as text
              set AppleScript's text item delimiters to oTIDs
              return t
    end recolle
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
              local k
              tell application a to activate
              tell application "System Events" to tell application process a
                        set frontmost to true
                        try
                                  t * 1
                                  if d is "" then
      key code t
                                  else if d is "c" then
      key code t using {command down}
                                  else if d is "a" then
      key code t using {option down}
                                  else if d is "k" then
      key code t using {control down}
                                  else if d is "s" then
      key code t using {shift down}
                                  else if d is in {"ac", "ca"} then
      key code t using {command down, option down}
                                  else if d is in {"as", "sa"} then
      key code t using {shift down, option down}
                                  else if d is in {"sc", "cs"} then
      key code t using {command down, shift down}
                                  else if d is in {"kc", "ck"} then
      key code t using {command down, control down}
                                  else if d is in {"ks", "sk"} then
      key code t using {shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "k" then
      key code t using {command down, shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "a" then
      key code t using {command down, shift down, option down}
                                  end if
                        on error
                                  repeat with k in t
                                            if d is "" then
      keystroke (k as text)
                                            else if d is "c" then
      keystroke (k as text) using {command down}
                                            else if d is "a" then
      keystroke k using {option down}
                                            else if d is "k" then
      keystroke (k as text) using {control down}
                                            else if d is "s" then
      keystroke k using {shift down}
                                            else if d is in {"ac", "ca"} then
      keystroke (k as text) using {command down, option down}
                                            else if d is in {"as", "sa"} then
      keystroke (k as text) using {shift down, option down}
                                            else if d is in {"sc", "cs"} then
      keystroke (k as text) using {command down, shift down}
                                            else if d is in {"kc", "ck"} then
      keystroke (k as text) using {command down, control down}
                                            else if d is in {"ks", "sk"} then
      keystroke (k as text) using {shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "k" then
      keystroke (k as text) using {command down, shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "a" then
      keystroke (k as text) using {command down, shift down, option down}
                                            end if
                                  end repeat
                        end try
              end tell
    end raccourci
    --=====
    --[/SCRIPT]
    --{code}
    tip #2 :
    --{code}
    --[SCRIPT rotate_cell_contents]
    Enregistrer le script en tant que Script : rotate_cell_contents.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule dont le texte doit être tourné de 90 degrés.
    Aller au menu Scripts , choisir Numbers puis choisir “rotate_cell_contents”
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: rotate_cell_contents.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell whose contents must be rotated for 90 degrees.
    Go to the Scripts Menu, choose Numbers, then choose “rotate_cell_contents”
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/06/23
    2011/06/26 -- No longer use an auxiliary text box. Now keep the text attributes.
    2012/01/31 -- edited for Lion
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2
              local le_texte, la_largeur, la_hauteur, myNewDoc
              my activateGUIscripting()
    Extract properties of the source/target cell *)
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
                        set selection range to range (name of column colNum1 & name of row rowNum1)
              end tell
    Cut*)
              my raccourci("Numbers", "x", "c")
    Trigger Preview *)
              tell application "System Events"
                        if "Preview" is not in (name of every application process) then launch application "Preview"
              end tell
      delay 0.2 -- required
    New document from the clipboard *)
              my raccourci("Preview", "n", "c")
    Rotate to left *)
              my raccourci("Preview", "l", "c")
    Copy *)
              my raccourci("Preview", "c", "c")
    Quit *)
              my raccourci("Preview", "q", "c")
              (system attribute "sys2") < 7
              if result then
    Click the [Don't Save] button in the warning sheet *)
                        tell application "Preview" to activate
                        tell application "System Events" to tell application process "Preview" to tell window 1
                                  name of buttons
                                  repeat 50 times
                                            delay 0.1
                                            if exists sheet 1 then exit repeat
                                  end repeat
                                  tell sheet 1 to click button 2
                        end tell
              end if
    Back to Numbers *)
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
      -- just reset the focus on the table
              end tell
    Paste in the cell *)
              my raccourci("Numbers", "v", "c")
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2
              tell application "Numbers" to tell document 1
                        set d_name to its name
                        set s_name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if

Maybe you are looking for