Correct way of setting styles for custom components

Hey everyone,
                        I have a custom component which extends UIComponent and holds a image and a button. If I want to set the default style for my button where do I set it in the createChildren, stylesInitialized ,  updateDisplayList  or styleChanged ? I know styleChanged gets called first but the param is always null
styleChanged = null
stylesInitialized
initialize
createChildren
initializationComplete
commitProperties
measure
updateDisplayList
Cheers,
Firdosh

Thanks for your recommendations. I have seen a lot of components (yahoo-astra e.g) call a static function or use Mixin (asfusion Rating Component)
public class CustomComponent extends UIComponent {
          public static function initializeStyles():void
               var styleDeclaration:CSSStyleDeclaration = StyleManager.getStyleDeclaration("BaseMultiFieldInput");
               if(!styleDeclaration)
                    styleDeclaration = new CSSStyleDeclaration();
               styleDeclaration.defaultFactory = function():void
                    this.backgroundColor = 0xffffff;
                    this.backgroundDisabledColor = 0xdddddd;
                    this.textAlign = TextFormatAlign.CENTER;
                    //other styles are based on the framework defaults
               StyleManager.setStyleDeclaration("BaseMultiFieldInput", styleDeclaration, false);
          initializeStyles();
is there a reasons why they are set in a static call?

Similar Messages

  • What's the correct way to set up an external style playing keyboard

    Hi
    what's the correct way to set up an external style playing keyboard?
    i want the keyboard to use the Logic's voices, and also to record the midi that is being inputed.
    I can do it on One Channel, but when I selct multiple channels, all the channels seem to play all of the input data!!!
    anybody??

    Check the formatting. It need to be formatted as Mac OS Extended (journaled). This is also known as HFS+.
    FAT32 and NTFS formatting will not work with iMovie.
    If necessary, you can reformat using Disk Utility.
    Make one large partition. No need for multiple partitions.
    Do moves or copies to the external drive through iMovie as detailed in iMovie Help. If you move Events in the Finder, they may become unlinked from the projects that use them.

  • What is the correct way to set up a new Mac

    A friend of mine recently migrated from Windows and bought himself an iMac. He got the local Apple store to set up his iMac and migrate his data from his Windows to his iMac. I was  recently helping him set up a few a additional things on his iMac and was supprised to see how the Apple store had set up the machine.
    There was only one account set up on the iMac and all of the user data had been loaded into this admin account. Now I've only been a Mac user for about 5 years, but I was always taught create an admin account with no data on it and then set up a separate user account(s) which contain all the user data and these are used by the users to log in.
    Now my question is who is right the Apple shop or me? I would e intertested to hear any experts views on the correct way to set up an OSX machine. 

    Both of you. Either way is acceptable. However, for a single user machine there's really no need to have more than the admin account.

  • IPad 2 Mail: Is there a way to set Rules for folders, similar to Mail in the iMac?

    iPad 2 Mail: Is there a way to set Rules for folders, similar to Mail in the iMac?

    Based on your answer, and the answer to another question (which I didn't see before I asked mine, even tho I searched), I get the impression that iPad Mail is just a different face on web mail, that the messages are only stored on the server, not downloaded and stored on the iPad 2. Is that correct?

  • Webserver - setting permissions for Custom Sites

    Quick q on setting permissions for custom sites default. Default home for custom (non-default) web site is:
    /Library/Server/Web/Data/Sites/ 
    and whatever subdirectory you stipulate, e.g. MyServer - or whatever.
    Server sets this as owner:
    drwxrwxr-x   7 root  admin  238 Mar  8 15:34 CustomSitesDefault
    drwxrwxr-x  16 root  admin  544 Mar  8 15:38 Default
    For security, shouldn't the permissions and ownership be changed - to some webamin user WITHOUT root privs? Or will this break Lion Server? Thanks.

    Hello,
    One option would be to disable the automatic Project Site Sync in the User Sync Settings Page, create custom permission levels and groups on your SharePoint Project site template(s) to meet your requirements - make use of default SharePoint groups where
    possible, save the new template(s) and attach the new templates to the EPTs. Then develop a Project Server event handler that adds the users to the Project Site on the Publish event (or what ever event you like). The project owner one is simple - just add
    the project owner to the new SharePoint group, project members - just read the project team and add those users and the visitors just add a domain AD group (Domain Users for example) to that group.
    Default Project Server sync settings / site permissions can be seen here:
    http://technet.microsoft.com/en-gb/library/cc197668(v=office.14).aspx
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Are there any set guidelines for customer master data cleansing.

    1) I was wondering if there are any set guidelines for customer master data cleansing.
    2) Part of the cleansing effort involves consolidating number of divisions etc. Any pointers to this regard?
    3) Also how do we deal with open docs, billing plans etc?

    The data cleansing requirement will take place, while move the data from legacy system to new target ERP / system. I.e. need to cleanse, enrich, de-duplicate, & standardize.
    The existing data may not have consistent format since it is often being derived from various sources. It may contain duplicate information as well missing or incomplete information. Cleanse and normalize content to achieve accuracy, consistency and proper understanding of the data.
    Also it’s a process of organizing the data, which will ensure enrichment of your data which are up-to-date, accurate, and complete. These processes are manual / labor intensive and require a fair bit of specialization.
    If you need to have more details please feel free to interact with us as per below.
    Thanks
    Kumar
    www deebrostech.com

  • Is there any way to Authorization Management for Material Components?

    Hello every body
       Is there any way to Authorization Management for Material Components? 
       For example  i want to create , delete , modify  Material Components,how i can Authorization Management ?
       Enhancement or IMG or other ways?
                                                                                    thanks

    Alas, no, not in VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • I want to install CCPL ,but it is not taking PAC file proxy.So please suggest an alternate way to set proxy for this exe file..

    I want to install CCPL ,but it is not taking PAC file proxy.So please suggest an alternate way to set proxy for this exe file..

    That file might have moved to a different location on the server. I think you'll need to check with RefWorks support or your local IT department on why the install page links do not work.

  • [svn] 4285: Exposed TLF' s new textJustify property on ParagraphElement as a CSS style for Gumbo components .

    Revision: 4285
    Author: [email protected]
    Date: 2008-12-10 16:08:28 -0800 (Wed, 10 Dec 2008)
    Log Message:
    Exposed TLF's new textJustify property on ParagraphElement as a CSS style for Gumbo components. It works with TextBox, TextGraphic, TextView, and components that use these primitives. When text is fully justified, this property determines whether the extra pixels are added between words or between any characters.
    QE Notes: Please add tests for this new functionality.
    Doc Notes: None
    Bugs: None
    Reviewer: Jason
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextBlockCompose r.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicParagraphFormatTextS tyles.as

    Hello xhpx,
    In  your media queries your changing the .gridContainer but the #LayoutDiv1 is the same. The reason the color goes away is the media query for mobile sizes doesn't have the background color. Though I would remove #LayoutDiv1 from any media query since it doesn't need to change.
    http://jsfiddle.net/gCka7/
    hope this helps.
    Chad Smith - BCGurus.com
    also, creating a jsfiddle or just a link to the site could make it easier for debuging.

  • What is the correct way to set up artwork for a Billboard?

    I need to set up photoshop artwork (which consists of about 5 layers) for a 6m x 3m billboard. I set up my whole billboard in Illustrator (at 3m x 1,5m - half of actual size) and placed the psd image in. I set up my photoshop artwork at a third of actual size (3m x 1m at 300dpi). However, this made my file VERY slow to work with (result was about 700mb!!!!). Someone suggested that I downscale the image to 500mm wide and choose resample image > Bicubic Sharper (best for reduction). This scaled my psd file to about 32mb, which worked much faster. Then I saved the psd file as a Tiff with LZW compression without layers and placed into my illustrator file. However, when I export for print as PDFX1a- 2001 my file size was only 17mb!!!! Did I do the whole process correctly?! Will the print quality still be fine for such a big billboard? Is there a better / standard way to set up photoshop graphics for a billboard?

    You can use this test to check ppi resolution.
    On your desktop printer print a few tiles from the image in real size at different ppi resolutions like 10, 20, 30, 40. Find a wall where you can mark 6 meters, and tape the tiles on it. Now step back to whichever is longer distance - from where you can see comfortably the whole size of the eventual billboard without turning your head or to the distance that will be possible to see the actual mounted billboard, . Choose the ppi resolution on which you can't see pixelation on the printed test tiles.

  • Best way to set layout of custom component

    Hi
    I'm creating a MultiComboBox component made up of a variable number of combo boxes. It's essentially a way for the user to select from a list, then a sub-selection list (then, if appropriate, a sub-sub-selection list etc) until a final selection is made. A sort of category hierarchy thing.
    Anyway, I've got it working, but it's bothering me that the layout (I'm currently using a grid layout) and the border are currently hard-coded in the constructor of the MultiComboBox. This seems to be the way that most custom components are created, although my MultiComboBox could easily work with a number of different layouts, so I'm thinking there must be a better way that would enable the user of the component to set their own layout and border. Is there an effective standard approach for going about this? I'm thinking I should be overriding a few methods of Component / JComponent / JPanel (which my MultiComboBox currently extends), like the getLayout(), getBorder(), so that they either return my default layout, or a layout the user has set with setLayout(). But then would I need to call validate() or something, and where should I be creating my array of combo boxes (currently I'm doing this in the constructor)?
    Any advice appreciated
    Martin

    Hm ...
    I use JTree for example to organize my application - say it is a kind of alternative menu and organizing system. It is a simple to use and very flexible component if you really have studied, how view, model and controller are working together - each of them can be manipulated or even replaced.
    The whole swing architecture is highly reconfigurable - I like it's design very much even so you have to struggle with it when you start using swing components for the first time :) - a very important point is to understand the event handling of the components - some people don't study that and struggle with invalidate() revalidate() and repaint() what is not needed at all, if you have understood which event to fire from which object :)
    greetings Marsian

  • Correct way of using LayeredPane for animation

    Hi,
    before I post my questions some background info (it has become quite a long story sorry for that, you can skip to the bottom if you want):
    i'm not an expert java programmer so I appologize for any stupid questions or remarks.
    Currently i'm implementing a road traffic simulation. Cars drive over roads, intersections etc. To make the movements/animation look smooth i've used doublebuffering or page flipping (I'm not sure while I used the getBufferStrategy() from a JFrame: strategy = frame.getBufferStrategy(); )
    To add my own JButtons created from .png file I've switched off the RepaintManager by creating a NullRepaintManager. The simulation thread is responsible for calling the repaint function, which is done every few milliseconds after the positions of the cars are updated. These buttons are added to the ContentPane of the frame which is made non-opaque to make the roadnetwork and cars visible (*i don't understand this)
    Btw I've 'borrowed' these ideas from 'developing games in java ' from Brackeen: http://www.brackeen.com/javagamebook/
    The roadnetwork and cars are drawn on the a Graphics2D by calling: (Graphics2D)strategy.getDrawGraphics(); first I draw an image of the roadnetwork to clear the old vehicle positions and then the new positions of the cars are drawn. after that the screen/frame is updated: strategy.show();
    This all works fine.
    The problems start when I want to have a popup JPanel to appear on the screen after I clicked somewhere on the roadnetwork. According to Brackeen this can be done by initializing a JPanel and add it to the LayeredPane of the JFrame and make it visible when needed. This does not work while the JPanel never pop's up and I don't understand why not, because the demo from brackeen works fine. When I add this JPanel to the contentPane it does popup but the buttons are shifted to the right which is not what i want.
    Also I want to add a JMenuBar to the frame, i thought I could simply used: frame.tsetJMenuBar(menuBar);
    however the menubar shows up next to my custom JButtons....
    ====>My Questions:
    What is the correct way to draw smooth animations inJava without slowing down the whole program when quite a large area has to be draw... this seems to happen e.g. in the Java demos: ..\jfc\Java2D
    How can I popup JPanels or internalFrames ontop of the animation?? probably by using the LayeredPane?
    I also want to add a JMenuBar in the normal position.
    Sorry for the long text and questions... but I'm struggling for almost two month with this now (using an increadible number of java books) and haven't solved it yet.
    Any suggestions are welcome Thanks in advance!!
    Rens

    It gets the first address from the pxelinux.0, another one is usually handed down after it boots, but sometimes it reuses it again. 
    Usually what happens on a diskless system is it tries to use the dhcpcd lease from the last diskless workstation (or possibly reuses the same one it gets from pxelinux.0).  But it has enough logic built into that it looks for another unique address for the next diskless workstation. 
    Do you have your pxeclient.cfg/default appended options set correctly to be ip=::::::dhcp? 
    Of course from the diskless wiki:
    label archxx
    kernel archxx/boot/vmlinuz-linux
    append init=/usr/lib/systemd/systemd initrd=archxx/boot/initramfs-linux.img root=/dev/nfs rootfstype=nfs nfsroot=xx.xx.xx.xx:/srv/tftp/archxx,v3,rsize=16384,wsize=16384 ip=::::::dhcp

  • Correct way to set up mutiple 4410Ns

    hello, we have 7 4410N's.  i am not sure i have them configured correctly, as connection is very slow, most of the time the connection gets an IP address, but then cannot transmit on network.  when you can, pings are 2000-3000ms.   each of them have ethernet connection, and identical configuration, save for each is set to a different channel (i think im using 1,3,5,6,7,9,11).  i am concerned there is some other issue i am not aware of with my configuration. 
    i would like to find out the correct way to configure multiple 4401Ns to work together on the same network, assuming same SSIDs are in use on each WAP.  can anyone offer me advice on what is correct?

    Jonathan,
    I assume that when you say "identical configuration" that you mean they have different IP addresses.
    How close are the APs to each other? With 7 of them using the channels that you have, if they are within range of each other they will have crosstalk.
    If you disable 6 of the APs, do you still get the high response times from the remaining one?
    - Marty

  • Generating a clientId for Custom Components

    I am creating a custom component that will be made up of smaller form elements and maybe even smaller custom components. Does JSF provide the mechanism for generating the clientId for each of these components and thier sub-components.
    What I don't want to do is this:
    writer.writeAttribute("name", clientId + "_id" + subComponentCounter++);
    ...

    I got that part. But what if your component has sub-components. Do you just name them whatever you want? I know that you could. But what if they are dynamically generated? And what if your sub-components have sub-components.
    So for example:
    Custom Control: Shipping Form
    |_Custom Control: Name Form
    | |_TextBox: First Name
    | |_TextBox: Last Name
    |_Custom Control: Address Form
    |_TextBox: Street
    |_TextBox: City
    |_TextBox: State
    |_TextBox: Postal Code

  • Set up for custom encode preset in Compressor for ATV2

    using compressor 3.0.5 i would like to set up a customer encode preset for atv2.
    ver 3.0.5 of compressor was released prior to atv2 so i would guess the current preset is for atv1.
    here is a screen copy of the specs:
    Name: H.264 for Apple TV
    Description: H.264 1280x720 video @ 5Mbps, progressive. Audio is 44.1 kHz, stereo
    File Extension: m4v
    Estimated file size: 2.1 GB/hour of source
    Device: Apple TV HD
    Frame sync rate: 5 seconds
    Video Encoder
    Format: QT
    Width and Height: Automatic
    Pixel aspect ratio: Square
    Crop: None
    Padding: None
    Frame rate: (100% of source)
    Frame Controls: Automatically selected: Off
    Codec Type: H.264
    Multi-pass: Off, frame reorder: On
    Pixel depth: 24
    Spatial quality: 50
    Min. Spatial quality: 50
    Temporal quality: 50
    Min. temporal quality: 50
    Average data rate: 5 (Mbps)
    Maximum data rate: 14 (Mbps)
    Audio Encoder
    Format: MPEG4
    Sample Rate: 44.100kHz
    Channels: 2
    Bits Per Sample: 16
    AAC encoder quality: high
    Data rate: 128 Kbps
    What changes should be made?
    Thanks in advance.

    You have to add the Service Offerings and the Request Offerings in the Catalog Group. Nesting doesn't work because Service Offerings and Request Offerings are different types of objects.
    This offers the option the manage the access to Service Offerings and Request Offerings very granular if needed. For instance you can control access to a Service Offering in one Catalog Group related to one user role (A) and use two additional Catalog Groups
    with different Request Offerings related to other user roles (B) and (C). Result will lead to:
    User in Role A and B -> Can see Service Offerings A containing Request Offerings B
    User in Role A and C -> Can see Service Offerings A containing Request Offerings C
    User in Role A, B and C -> Can see Service Offerings A containing Request Offerings B and C
    User in Role A only -> Don's see anything because of the missing permission on any Request Offering. So the "empty" Service Request won't show up in the portal.
    Hope his helps.
    Andreas Baumgarten | H&D International Group

Maybe you are looking for