Sharing Actions between GUI Components

Hi,
i have an MyPanels (JPanels) as tabs in JTabbedPane.
Each of MyPanels instances has own Actions (save, copy, paste, cut).
I want to put this actions in the toolbar of a JFrame.
The way i do it so far, is creating "dummy" Actions for a toolbar, and setting them each time the selected tab changes. I never use the "dummy" Actios, i just need them in toolbar, even when no tab selected ...
The first problem is i have to reset the actions for components each time as well (because the buttons configure from actions, don't use them. ..)
Is there any other solution for it?
I put all actions of MyPanel to an extra ActionMap, and get it to the parent frame.
I don't think it is the best solution ...
And i create actoins in Jframe, which i never use really ...
For now i have following solution in my JFrame class:
jTabbedPane.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
               m_currentPane = getCurrentMyPane();
               updateTabsActions();
private void updateTabsActions(){
      if(m_currentPane!= null){        
            ActionMap actions = m_currentPane.getActions();
            saveFile_action = actions.get(saveFile_action.getValue(Action.NAME));
            jButton_Toolbar_SaveFile.setAction(saveFile_action);
            jMenuItem_FileSave.setAction(saveFile_action);
            copy_action = actions.get(copy_action.getValue(Action.NAME));
            jButton_Toolbar_Copy.setAction(copy_action);
            jMenuItem_EditCopy.setAction(copy_action);
        else{
            saveFile_action.setEnabled(false);
            copy_action.setEnabled(false);
}Has anybody a good solution to general share actions beteween components?
Thx for any answers, ideas, codes
Katie

Why dont you try interfacing?
make each panel ot tabbed pannel implemet this interface
public interface MyActions{
    public void save();
    public void cut();
}Then when the save button is pressed, the action should be :
JButton save=new JButton("Save");
save.addActionListener(new ActionListener(ActionEvent e){
              getCurrentOrSelectedPanel().getMyActions().save();//
               // I dont remmeber how to swap between panels, but I think you got the idea!!
                //you dont need to change the actions after that!!
//Do the same for every button. :
getCurrentOrSelectedPanel().getMyActions().cut();//
getCurrentOrSelectedPanel().getMyActions().paste();//This way the save Button for example, will have different save operations depending on the current displayed panel.

Similar Messages

  • GUI Components & Graphical drawings

    Hi,
    I�m new to Swing (haven�t done much GUI since Motif!) and I�m a little confused about the relationship between GUI components and �drawn� graphics.
    In my application I have two JPanels � an upper and a lower � that display two views of the same data,
    In both of these JPanels I do my graph drawing using g.drawXXX() or g.fillXXX().
    I label the displays using g.drawString()
    However, I want to add some checkboxes to one of the JPanel displays that will trigger actions in the other JPanel. I�m not sure how to get the checkboxes to show up in the right place. It feels like the GUI components work in Layout mode whereas the graphics are in x,y coordinate space.
    I see that JComponent has setLoaction / setBounds methods � but I�ve not had any joy with these so far.
    I can see that I could create my own JComponent subclass that has the GUI and the graphics area and this could use a Layout to line things up.
    Basically � can I draw GUI components at an x,y coordinate on a JPanel?
    If this sounds like bad practice I�d welcome any sources of reference.
    Many thanks.

    Hi,
    My question probably sounds more complicated than it is owing to my inexperience with Swing. I'm sure what I'm after is done thousands of time in other apps.
    Bascially I have two set of graphs -
    One is pure graphical (plotting stock prices etc.).
    The other contains horizontal "bar" format data that lines up below the stock price graph
    (Again see latest posting here : http://www.chriswardsweblog.blogspot.com/)
    What I'm after is to have some controls at the right hand end of each bars. Presently I would imagine these to be a JCheckBox and maybe a JLabel to replace the g.drawString() rendered label in the screenshot.
    The reason I want this is that the upper graph area shows a plotted view of the bar data. I want to be able to check/uncheck the box to see the plotted quote lines turn on/off.
    I am pretty sure that I need to divide that lower JPanel into a "Graphical" panel for the bars and a "Component" panel for the controls. That feels like the correct thing to do - I just wanted someone to confirm I wasn't getting the wrong end of ths stick.
    If this is the case - I think I need to sort out what Layout I should use that will allow me to get the JCheckbox & JLabel to line up with the bars. I have been look at the Box layout which would seem to allow me to do that.
    I have another open question in this forum about how to toggle the visibilty of the upper panel quote lines - maybe that's where I need a Glass Panel?
    Does this clarify things?
    Thanks for all help.

  • Save GUI components in a XML format

    I am looking for a technoology that can help to create a my own file format using java. That mean currently im working with implementing a mind mapping tool (like mindjet) which will help to do basic mind mapping actions like add, edit, delete topics.
    But I have faced for a ig problem when im saving a created map. because it should save as a new file format and should be able to re-open for editing.
    What I planned is to retrive the GUI component's(elements of the map) properties from the map and write those values to the XML file(using XML DOM or SAX). Then read those saved values and create the GUI components under retrieved data.
    what I want to know is that. Is my approach is correct? or is there any better solution for this matter?
    please clarify me and I would really appreciate your help?
    Regards
    Lakshitha Ranasinghe

    You presumably have some state, in memory, that you want to persist. From your post, though I must confess that the terms you use are not really clear in terms of what type of data you actually want to say, my guess is that you have some graph of objects in memory that you have parsed that you want to serialize and persist and then later deserialize and restore for reuse in a subsequent execution of your program.
    If yes, then your goal is really simple: how do I save the state of my application and then restore it?
    Go to the filesystem: store as a properties file (key-value pairs), Java's default serialization, XML or a totally custom format
    Go do the database: map your object to a proper database table and column (via JDBC or an O/R mapper ala Hibernate), or store what you would have stored in the filesystem in a databaseXML is a valid option. So is a simple properties file. It depends on your requirements. If you are reading from and writing to a Java application, and frequent versioning is not an issue, then Java's default serialization could be a possibility. Going to the database would be the 'enterprise' solution, but requires testing and the successful functioning and communication between two technologies and machines. It depends on your requirements.
    - Saish

  • [SOLVED] Slow Desktop GUI components

    Arch Linux 64
    i5 -2500k  / 8GB Ram /  Nvidia with the closed source drivers
    OpenBox
    LXPanel
    compton-git (from AUR)
    I am running into a strange recurring problem for some time now.
    Even though running and launching applications is fast, various GUI components of individual apps are lagging.
    For example moving through the preferences tabs of Pidgin, or preferences tabs of firefox, or changing between open tabs in Firefox( does not happen in Chrome) or generally using the GUI dialogs of certain applications might take 2-3 seconds from the time I clicked to the gui component to the time the change occurs (for example changing from one preference tab to another).
    I do not have any performance issues generally in the system, except those gui components that are painfully slow.
    Things i have tried so far:
    -Initially i thought it was only manifesting in firefox so I reseted the profile but that did not improve the situation.
    -I thought it might have to do with GTK so I deleted the .gtk-bookmarks from home dir (in order to be recreated) but that did not improve the situation. I still believe it might have something to do with GTK.
    any suggestions are greatly appreciated.
    Last edited by mastorak (2014-05-19 19:56:16)

    After more experimentation I am now fairly certain that the issue is caused by compton.
    I looked into the bugs reported for compton and apparently there are some issues caused by it when used with the nvidia driver having set the backend option to "glx".
    With the following compton config it seems to be working correctly with no slowness.
    backend = "xr_glx_hybrid"
    vsync = "opengl-swc"
    glx-no-rebind-pixmap = true
    glx-no-stencil = true
    paint-on-overlay = true
    unredir-if-possible = true
    Note that the backend "xr_glx_hybrid" config option is only available(for now) from the "compton-git" package and not "compton" package.
    I do not mark it yet as "Solved" as I want to use it for sometime to be certain.
    edit:for syntax errors
    Last edited by mastorak (2014-05-19 08:38:28)

  • Initializing JDialogs or Other GUI Components within SwingWorker

    Hello Every one,
    I have been using SwingWorker class heavily in my application and recently I noticed that If I click on a button twice or thrice the third or 4th it takes more time to perform the action in which SwingWorker is being used. So I started reading more about SwingWorker and after reading number of articles and posts on this forum I believe I am not using SwingWorker correctly. But, I am not still sure ( or may be I am afriad or I am not ready to change my code in so many files and so many locations :(
    So I thought to ask some gurus following questions, in this forum before I proceeed with the code refactoring.
    Question 1:* I am performing GUI operations in doInBackground() is it ok to perform swing operations or create swing components in this method of SwingWorker?
    Example Code :
    jbtnModifyUser Action Event
    private void jbtnModifyUserActionPerformed(java.awt.event.ActionEvent evt) {
    setButtonsState(false);
    final SwingWorker worker = new SwingWorker() {
    protected Object doInBackground() {
    try {
    openUserModifierDialog(SELECTED_PROFILE);
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    return null;
    public void done()
    setButtonsState(true);
    worker.execute();
    }Open Dialog Method wich I call from several other Swing Components Action performed event
    private void openUserModifierDialog(UserProfile profile) throws ServerException {
    UserModifierDialog modifier = new UserModifierDialog(_frame, true, profile);
    modifier.pack();
    modifier.setVisible(true);
    if (modifier.isModified()) {
    resetFields();
    populateUserTable();
    } If I click 3 to 4 times same button the 4th or 5th time the dialog opens after soem delay like 10 seconds. But in first two three click it opens quickly like in 2 to 3 seconds. Is it due to the fact that I am perfoming Swing GUI operations in doInBackgroundMethod()?
    Question 2: Should I use EventQueue.invokeLater() but as far as I have learned from the articles, the actionPerformed events already run on EDT.
    Question 3:_ Each dialog has multiple swing components like combo boxes, tables, tress which it populates after fetching data from the Database in its constructor. It takes like 1 to 2 seconds to bring data and initialize all swing components. Once the Dialog is initialized in the constructor I call my own function to set the existing user details ( As shown below ).
    I need to set all the details before I show the Dialog to the user. To achieve this what is the best practice? Where should I use SwingWorker in current scenario? in Dialog's PostInitialize()? In Dialog's Constructor()? or in the Frame's openModifierDialog()?
    public UserModifierDialog(java.awt.Frame parent, boolean modal, UserProfile userprofile)
    throws ServerException {
    super(parent, modal);
    if (userprofile != null) {
    SELECTED_USER_PROFILE = userprofile;
    }else{
    //throw new Exception("Invalid user record. User profile cannot be null. ");
    initComponents();
    postInitialize(); // my function called to set the user details on the screen
    private void postInitialize() throws ServerException {
    _userManager = new UserManager();
    initializeAllPermissions();
    initializeUserGroups();
    setFields(SELECTED_USER_PROFILE);
    private void initializeUserGroups() throws ServerException {
    _jcbUserGroup.removeAllItems();
    _jcbUserGroup.setModel(new ArrayListModel(_userManager.getAllUserGroups ()));
    _jcbUserGroup.setSelectedIndex(0);
    private void setFields(Userprofile profile) throws ServerException{
    _jlblUserID.setText(profile.getUserid().toString());
    _jtfUserName.setText(profile.getUsername());
    _jtfFirstName.setText(profile.getFirstname());
    _jtfLastName.setText(profile.getLastname());
    _jtfPassword.setText(profile.getPassword());
    _jtfConfirmPassword.setText(profile.getPassword());
    _jtaDescription.setText(profile.getDescription());
    _jcbUserGroup.setSelectedItem(_userManager.getUserGroup(profile.getUserGroupID()));
    } Question 4: I noticed that if I use following code in my openModifierDialog function to execute the worker rather then its own execute method the dialog opens quickly each time.
    Is it good idea to use the following to execute a SwingWorker or I shouldn't as I may fall in some threading issues later on which I am not aware of?
    Thread t = new Thread(worker);
    t.start();Hope to hear some useful comments / answers to my queries.
    Thanks in advance.
    Regards

    Thanks for your prompt reply and answers to my queries.
    Well, I know there are enormous faults in this code. Thats why I am seeking guru's advice to clean the mess. Let me give you breif background of the code. The current code was written by some one else using old version of SwingWorker and I am just trying to clean the mess.
    All the JDialog or Swing Components intialization code was in construct() method of previous SwingWorker. Later on when the SwingWorker became the part of Java SE 6 all application code was refactored and the GUI components initialization was moved to the new function doInBackground().
    The sample code represents the current condition of the code. All I needed was a shortcut to clean the mess or to avoid changes at so many places. But it seems that there is no easy workout for the current situation and I have to change the entire application code. I have gone through the SwingWorker API and tutorial @ [http://java.sun.com/developer/technicalArticles/javase/swingworker] and I am doing following to clean this mess.
    Well the following code is proposed refactoring of the previous code. Hope to hear your comments on it.
    private void jbtnModifyUserActionPerformed(java.awt.event.ActionEvent evt) {
    try{
    openUserModifierDialog(SELECTED_PROFILE);
    } catch (Exception ex) {
    logger.error(ex);
    //show some message here
    } finally {
    private void openUserModifierDialog(UserProfile profile) throws ServerException {
    UserModifierDialog modifier = new UserModifierDialog(_frame, true, profile);
    modifier.pack();
    modifier.setVisible(true);
    if (modifier.isModified()) {
    resetFields();
    //UserModifierDialog Constructor
    public UserModifierDialog(java.awt.Frame parent, boolean modal, UserProfile userprofile)
    throws ServerException {
    super(parent, modal);
    if (userprofile != null) {
    SELECTED_USER_PROFILE = userprofile;
    } else {
    //throw new Exception("Invalid user record. User profile cannot be null. ");
    initComponents();
    postInitialize(); // My function called to set the user details on the screen
    private void postInitialize() {
    _userManager = new UserManager();
    setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
    final SwingWorker worker = new SwingWorker() {
    protected Object doInBackground() {
    try {
    return _userManager.getAllUserGroups(); //returns ArrayList of all user groups from database
    } catch (ServerException ex) {
    //Show Message here
    return null;
    protected void done() {
    try {
    if (get() != null) {
    _jcbUserGroup.setModel(new ArrayListModel((ArrayList) get()));
    _jcbUserGroup.setEditable(false);
    setFields(SELECTED_USER_PROFILE);
    else
    //show some error to user that data is empty
    } catch (InterruptedException ex) {
    //show message here
    } catch (ExecutionException ex) {
    //show message here
    } finally {
    setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
    worker.execute();
    private void setFields(Userprofile profile) throws ServerException {
    _jlblUserID.setText(profile.getUserid().toString());
    _jtfUserName.setText(profile.getUsername());
    _jtfFirstName.setText(profile.getFirstname());
    _jtfLastName.setText(profile.getLastname());
    _jtfPassword.setText(profile.getPassword());
    _jtfConfirmPassword.setText(profile.getPassword());
    _jtaDescription.setText(profile.getDescription());
    _jcbUserGroup.setSelectedItem(_userManager.getUserGroup(profile.getUserGroupID()));
    }In some places where data is way too huge I am going to use process and publish methods of SwingWorker.
    Now I have another question, how I can notify/throw any exceptions occured inside SwingWorker doInBackground method or done method to the function who executed SwingWorker. Currenlty I am catching the excpetions in the done method and showing a dialog box. But I want to throw it to the postInitialize method the method who created and executed the Worker. What is the best practice of handling exceptions in SwingWorker methods.
    Do you see any problems in proposed refactoring?
    Hope to hear your comments.
    Regards

  • CP7 Shared Actions Help needed

    Hi folks.
    Looking for some help with something I'm trying to do with the new cool Shared Actions.
    First of all here is the Set up!
    What i am trying to achieve is to test if a person has followed a decision tree correctly.
    The tree will take them eventually to one of 3 possible outcomes and each person who follows the tree will be looking at a unique set of circumstances so I can't say for any of the individual choices on the tree if it is correct or wrong.
    Each choice they make is set up as a slide with a yes or no button.
    As they click yes or no I am taking them to the appropriate next decision on the tree.
    At some point they will reach a 'final' slide that tells them they should be ready to choose between the 3 possible outcomes. 'Create'  'Keep' or 'Dismiss' and offers those choices.
    I actually built 3 identical versions of this slide. I built them as MC questions so that for each of the options I can have a right answer that I can feed back to my LMS to tell me that the learner has made the correct decision.I made sure that the quiz is Branch Aware so as the user will only be presented with one question (based on the choices they took on the tree) they will either score 100% or 0%.
    I managed to do all this successfully using advanced actions.
    For each button that took me to the 'final question' slide I had to write a specific advanced action that moved a feedback message to a message variable (using an assign) and then jumped to the appropriate final question slide.
    The problem for this is that it is a specific advanced action for each slide that could take them to the final slide. And there are several in this project. and i will need to do the same thing for maybe a dozen other projects.
    So I tried to set these up as advanced actions.
    I had hoped to be able to have the variable and the target page as parameters.
    But what I cannot seem to do is have the variable as one of the parameters.
    Have I missed something about Shared Actions or is this a limitation.
    Or can someone think of a better way to achieve what I'm aiming for.
    Thanks
    Alan

    And we also need to be able to execute Advanced Actions and Conditional Advanced Actions from within other Advanced Actions or Conditional Advanced Actions.  That would give us something similar to programming functions in normal code.  But it would potentially create all manner if issues with endless loops.  So Cp will need some way of detecting unsafe conditions that could break the published output.  Something it's never been very good at doing in the past.

  • Plugging actions into GUI by means of configuration files and

    Hi,
    I'm looking for a tricky design pattern which will permit to plug Action objects into a Swing UI, using xml config files or whatever format. but it seems to be a little difficult, since requests must collect data from GUI components to perform the correct request.
    the Chain of responsabilities pattern could be a solution for it's based on a chain of handlers.the handlers handle one by one the request and finally the request generates a command which will be executed and which will update the model. finally the GUI will be updated by a sort of ModelChangedEvent. The remaining problem to resolve is where to begin.
    what are the interfaces of the handlers for example
    the solution must be the most generic as possible.
    So any suggestions?
    Ramzy
    Paris

    deja vu... did you or somebody else not post this exact message several months ago?  Or am I just mixing up past present and future again? :-D
    What I remember is this discussion coming up, somebody reminding the poster that there is a NoUpgrade option to allow specific files to not be overwritten in /etc/pacman.conf (for example: NoUpgrade = etc/inittab ). and Judd eventually making some kind of additional option to pacman to make it so that NoUpgrade is the default for something if that's what you want.
    I swear I've read your message word for word in the past.  I'm scared now... :oops:
    Dusty

  • Sharing jsp between multiple controllers

    Is there a way to share a jsp between 2 different controllers?
    If I put the shared jsp in its own directory and the 2 controllers in their own directories - I seem to be able to use netui:anchors and specifying the fully qualified "href" attribute - but not the "action" attribute. For example this works (but means I have to specify the exact controller):
    <netui:anchor href="/portlets/Controller1/findAction.do">
                find
    </netui:anchor>This does <b>not </b>work:
    <netui:anchor action="findAction">
                find
    </netui:anchor>Additionally, if I want a form to be on this shared jsp - I don't know of a way to use the netui tags to accomplish this... This example results in an error (as if it's trying to find the action in Global.app):
            <netui:form action="submitSharedForm">
                <table>
                    <tr valign="top">
                        <td>Foo:</td>
                        <td>
                        <netui:textBox dataSource="{actionForm.foo}"/>
                        </td>
                    </tr>
                </table>
                <netui:button value="submitSharedForm" type="submit"/>
            </netui:form>Are there other better techniques for sharing jsps between multiple controllers (jpf)? The only other thing I was thinking of trying to have a jsp found within the same directory as the controller include the shared jsp (which seems kind of tacky)...

    You may consider using a base pageflow controller that has the common JSPs
    in its directory. I have done that before like this:
    // inheritLocalPaths=true lets us inherit the JSPs from the base pageflow
    @Jpf.Controller(
    inheritLocalPaths=true
    public class MyChildController extends MyBaseController
    Ture Hoefner
    WebLogic Portal Engineering
    <Tim Rafert> wrote in message news:[email protected]..
    Is there a way to share a jsp between 2 different controllers?
    If I put the shared jsp in its own directory and the 2 controllers in
    their own directories - I seem to be able to use netui:anchors and
    specifying the fully qualified "href" attribute - but not the "action"
    attribute. For example this works (but means I have to specify the exact
    controller):
    <netui:anchor href="/portlets/Controller1/findAction.do">
    find
    </netui:anchor>This does <b>not </b>work:
    <netui:anchor action="findAction">
    find
    </netui:anchor>Additionally, if I want a form to be on this shared jsp - I don't know of
    a way to use the netui tags to accomplish this... This example results in
    an error (as if it's trying to find the action in Global.app):
    <netui:form action="submitSharedForm">
    <table>
    <tr valign="top">
    <td>Foo:</td>
    <td>
    <netui:textBox dataSource="{actionForm.foo}"/>
    </td>
    </tr>
    </table>
    >            <netui:button value="submitSharedForm" type="submit"/>
    </netui:form>Are there other better techniques for sharing jsps between multiple
    controllers (jpf)? The only other thing I was thinking of trying to have
    a jsp found within the same directory as the controller include the shared
    jsp (which seems kind of tacky)...

  • Hello there - how can I share my iTunes library between two users on the same computer? I put the library in a shared folder between both and have selected this library on both as well, but when I update iTunes with music etc it only appears on one?

    Hello there - how can I share my iTunes library between two users on the same computer? I put the library in a shared folder between both and have selected this library on both as well, but when I update iTunes with music etc it only appears on one?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • Sharing files between users and macs

    My husband and I share an iMac. I have a MBA for traveling and my husband a PC laptop (though he rarely uses for private stuff). We both have iPhones.
    We are looking for a way to:
    - Share our photos (we don't use iPhoto) and some files. We would like to have this in one shared folder, that we can access from both accounts in the iMac, the MBA and ideally (though not a must) the PC and iPhones. We would both need to have admin rights to edit documents, etc.
    - Have access to all the information in my account on the iMac from the MBA. Ideally, same thing for his and the PC.
    - Have access to all the data remotely when traveling.
    - Have all the data backed up locally (we already have a cloud backup, but we'd like to have a local backup too as it's easier and quicker to access)
    We have read a lot about configuration, NAS, time capsule... but we get more and more confused, as we are obviously no tech experts.
    Dropbox is not our preferred choice. We already have a cloud backup system. We'd rather have the files stored and accessed locally for everyday use.
    Using a NAS to store shared folders and backup the rest sounds good, but they either seem very complicated to set up, or they have mixed reviews in terms of stability, especially to access files remotely.
    Timecapsule seems easier and more straightforward, but I'm not sure it would solve the "sharing files between users and macs with admin rights"? It seems to be more focused on backing up the main drive and then providing access to the backed up files. (Though I might be completely mistaken!)
    We just can't manage to have one shared folder between both accounts in the iMac. We need to grant admin rights document by document. We don't manage to make it work automatically so we both have one folder to access with full rights for all the contents inside it. And this seems to me like something that should easily be done...?
    Any help, advice, proposals... would be greatly appreciated!!!

    Move any file you want to the other user to access to the Shared Folder. Anything you put in that folder is available to all users.
    The shared folder is here:
    Macintosh HD > Users > Shared

  • Sharing information between tiled view and view bean

    I have come across one more problem. I have a search result
    page. This search result page has a static text field and a repeated group
    (I simplified the page description, for explanation purpose). In the NetD
    implementation they are maintaining a page level attribute (say boolean
    haveSenisitiveCustomers) and setting this attribute in the
    afterDataObjectExecute event. (This data object is associated with the
    repeated). In end display event of static text field, they are displaying
    message say " due to Registration type, not all customers meeting the
    criteria are listed") if the haveSensitiveCustomers flag is set.
    After Migration, the boolean flag and static Text Field movedto
    SearchResultViewBean and afterDataObjectExecuteEvent has moved to
    TiledViewBean. Actual processing done is more complicated than this
    explanation. However, it boils down to sharing information between
    tiledViewBean and its parent bean. How do we achieve this in the Migrated
    Application?
    One way is to add getter methods in the child tiled view bean( to
    access in parent view bean, call getRepeated1 and cast to the actual type
    and invoke the get methods)Probably the typical solution (I say typical because I don't yet know) will
    be to do what you suggest: provide methods between views that can be used to
    determine the state needed for processing like this.
    However, let me alert you to something that's different than ND, and which
    may cause you some trouble. In ND, all retrieving DataObjects associated
    with a page executed at one time, and the afterDataObjectExcecuteEvent fired
    before any display processing began. However, in JATO, tiled views are
    independent objects, and any models associated with them only execute when
    the tiled view is first displayed.
    Therefore, if the static test field you refer to appears in the page before
    the tiled view, then the tiled view will not have executed its associated
    model before the static text field is rendered. You will never see the
    static text field display the text you want because you won't have the
    information at display time. (If the text field appears after the repeated,
    then it's not problem, as the display of the tiled view will have executed
    the associate model before the field displays.)
    The solution is to manually reference the tiled view and its associate model
    before they would normally execute. You would execute the model and set the
    tiled view's setAutoRetrieveEnabled() to false to prevent it from executing
    the model a second time. Perhaps the easiest thing to do would be this:
    beforeStaticTextDisplay(...)
    // Force the tiled view to execute the associated model
    Repeated1TiledView tiledView=
    (Repeated1TiledView)getChild("Repeated1");
    tiledView.beginDisplay();
    tiledView.setAutoRetrieveEnabled(false);
    Although the beginDisplay() method will be executed twice in this case (once
    deliberately, above, and later during actual display), there should be no
    overhead. The beginDisplay() method doesn't do anything anyway except
    execute associated auto-retrieving models and fire the
    afterAllModelsExecute() event.
    Mike, do you concur or have any comments?
    This explanation rests on the understanding of a number of other subjects,
    some of which you may not be fully familiar with. Feel free to ask further
    questions about this explanation.
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...

    I have come across one more problem. I have a search result
    page. This search result page has a static text field and a repeated group
    (I simplified the page description, for explanation purpose). In the NetD
    implementation they are maintaining a page level attribute (say boolean
    haveSenisitiveCustomers) and setting this attribute in the
    afterDataObjectExecute event. (This data object is associated with the
    repeated). In end display event of static text field, they are displaying
    message say " due to Registration type, not all customers meeting the
    criteria are listed") if the haveSensitiveCustomers flag is set.
    After Migration, the boolean flag and static Text Field movedto
    SearchResultViewBean and afterDataObjectExecuteEvent has moved to
    TiledViewBean. Actual processing done is more complicated than this
    explanation. However, it boils down to sharing information between
    tiledViewBean and its parent bean. How do we achieve this in the Migrated
    Application?
    One way is to add getter methods in the child tiled view bean( to
    access in parent view bean, call getRepeated1 and cast to the actual type
    and invoke the get methods)Probably the typical solution (I say typical because I don't yet know) will
    be to do what you suggest: provide methods between views that can be used to
    determine the state needed for processing like this.
    However, let me alert you to something that's different than ND, and which
    may cause you some trouble. In ND, all retrieving DataObjects associated
    with a page executed at one time, and the afterDataObjectExcecuteEvent fired
    before any display processing began. However, in JATO, tiled views are
    independent objects, and any models associated with them only execute when
    the tiled view is first displayed.
    Therefore, if the static test field you refer to appears in the page before
    the tiled view, then the tiled view will not have executed its associated
    model before the static text field is rendered. You will never see the
    static text field display the text you want because you won't have the
    information at display time. (If the text field appears after the repeated,
    then it's not problem, as the display of the tiled view will have executed
    the associate model before the field displays.)
    The solution is to manually reference the tiled view and its associate model
    before they would normally execute. You would execute the model and set the
    tiled view's setAutoRetrieveEnabled() to false to prevent it from executing
    the model a second time. Perhaps the easiest thing to do would be this:
    beforeStaticTextDisplay(...)
    // Force the tiled view to execute the associated model
    Repeated1TiledView tiledView=
    (Repeated1TiledView)getChild("Repeated1");
    tiledView.beginDisplay();
    tiledView.setAutoRetrieveEnabled(false);
    Although the beginDisplay() method will be executed twice in this case (once
    deliberately, above, and later during actual display), there should be no
    overhead. The beginDisplay() method doesn't do anything anyway except
    execute associated auto-retrieving models and fire the
    afterAllModelsExecute() event.
    Mike, do you concur or have any comments?
    This explanation rests on the understanding of a number of other subjects,
    some of which you may not be fully familiar with. Feel free to ask further
    questions about this explanation.
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...

  • Sharing photos between multiple users on one Mac

    I'm trying to figure out how to easily share photos imported in by one user to other users in my family on my mac. I'm assuming we don't have to import them multiple times. It seems cumbersome to this new mac user to share them. I find the issue with iTunes. Any help?

    HI Darien,
    Here are all the links I have for the different kinds of sharing:
    SHARING IPHOTO LIBRARIES
    Sharing libraries between users on the same local network
    You can also share a library on the same machine between users the same way.
    Sharing libraries between users on the same machine...
    -both users must have sharing enabled in their iPhoto Preferences
    -both users must be logged in and have iPhoto running
    -Remember that you can only view the other library. You can't edit the photos or play the saved slideshows or view the made books or burn them to CD or DVD. The books and slideshows will show up as an album. You can play that album as an "on the fly" slideshow. You can drag images from the sharing library to your library in the source column to import them to your library. You can then edit, add to albums, books, slideshow, etc.
    Sharing links from Apple....
    Sharing your photos between computers
    About shared photos
    Turning off photo sharing
    Looking for shared photos
    SHARING ONE IPHOTO LIBRARY BETWEEN USERS ON SAME MACHINE
    You can try one of these three methods:
    1- Use iPhoto Library Manager-the paid version
    The documentation page will give instructions on how it is done.
    2- Sharing one iPhoto library between several users on one machine
    3- Share an iPhoto Library in tiger Using ACL's
    4- I have also read about ShareAlike
    There is no other info on the site about how it works.
    I strongly urge anyone wanting to try any of the methods for sharing one iPhoto Library folder among more than one user to backup all iPhoto Library folders before attemptin anything.

  • Event handling in custom Non-GUI components

    I have a class which needs to fire events to outside. These events maybe captured by several objects in outside world. How can I achieve this? In so many places I read, they always refer to AWT and Swing whereas my objects don't have any dependency to GUI.
    I simply need to fire an event from an object, and capture that event from other objects by registering event handlers.
    I have experience in .Net programming with Events and Delegates (function pointers), but cannot find something like that in Java. All it offers is various kinds of GUI related Listeners where I can't find a proper help resource using them in Non-GUI components.

    ravinsp wrote:
    I have a class which needs to fire events to outside. These events maybe captured by several objects in outside world. How can I achieve this? In so many places I read, they always refer to AWT and Swing whereas my objects don't have any dependency to GUI.
    I simply need to fire an event from an object, and capture that event from other objects by registering event handlers.
    I have experience in .Net programming with Events and Delegates (function pointers), but cannot find something like that in Java. All it offers is various kinds of GUI related Listeners where I can't find a proper help resource using them in Non-GUI components.If you want to make your own Listener make your Listener. Create an event class that encapsulates the event as you want, create a listener interface that has a method like handleMyEvent(MyEvent me) and then add addMyEventListener, removeMyEventListener methods to your original class. Add a List<MyEvent> to your original class and add the listeners to it and then when events happen
    MyEvent someEvent = new MyEvent();
    for(MyEventListener mel : eventlisteners)
       mel.handleMyEvent(someEvent);

  • SAPgui.exe is running even after closing the GUI components

    Hello All,
    Even after closing the SAP GUI components like Bex, WAD or RSA1 etc... i am able to see these processes are running under the Task Manager--> Processes....
    even if i try to restart the system, error messages are occuring...saying that SAP is still opend...
    Why it is happening, any ideas?
    Thanks,
    Ravi

    Hi Dirk,
    Thanks for your infomation. Infact, apart from this problem, i have the problem with saving the webtemplate. As it is taking much time to save a template after modifications, i had to terminate the wad process. It seems above 2 problems are related....any ideas?
    Thanks
    ravi
    Message was edited by: Ravi Pasumarty

  • Customer gui components needed?

    I require to build a program with which allows the user to add representations of objects onto the main GUI by adding a seperate square for each object. each square should be capable of being moved, resized, deleted as well as have text displayed in it, and another object associated with it (but I'm currently just dealing with the GUI side of things). Each square will also need to be connected to others by means of an arrow from one square to another. Any suggestions as to where to start as there does not seem to be any appropriate widgets provided by java for this and I am having trouble finding stuff on the net about it. Will creating my own custom GUI components be the best option? If so any tips on how to do this?
    Regards

    Hello Ravi,
    Create a Variable for 0CALMONTH, and use this code,
    ' Declare this in the top
    data : v_startmon(6) type n,
    v_endmon(6) type n,
    ' Include this in the case statement
    when 'VarName'.
    ' Step 2 will execute after the user Input
    if i_step = 2.
    v_year = sy-datum(4).
    v_mon = sy-datum+4(2) - 1.
    ' If the month is Jan
    IF v_mon = '00'.
    CONCATENATE v_year '01' INTO v_startmon.
    CONCATENATE v_year '01' INTO v_endmon.
    ELSE.
    CONCATENATE v_year '01' INTO v_startmon.
    CONCATENATE v_year v_mon INTO v_endmon.
    EndIF.
    clear l_s_range.
    l_s_range-low = v_startmon.
    l_s_range-high = v_endmon.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    append l_s_range to e_t_range.
    Endif.
    Please see this for
    [User Exits in SAP BW|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/23f2f094-0501-0010-b29b-c5605dbdaa45]
    [User Exit Examples|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef]
    Also see this
    [Dependencies for Variables of Type Customer Exit |http://help.sap.com/saphelp_nw04/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm]
    Thanks
    Chandran
    Edited by: Chandran Ganesan on Mar 17, 2008 1:57 PM

Maybe you are looking for