Create Flex Skin, custom Event and other classes easily

Do you know that one of the most effective ways of writing code in IntelliJ IDEA is Create From Usage approach, when first use a class, method, or other symbol, and IntelliJ IDEA then generates its declaration in a single click? Well, you do now, plus I’d like to give you two more examples of useful quick fixes that can generate routine code for you in no time.

Create Flex Skin

IntelliJ IDEA knows which MXML attributes must contain qualified name of a class. Class doesn’t exist? Invoke quick fix and get it right away.

In case of Skin class its behavior is even smarter. Write a skin class usage…

… and get MyButtonSkin.mxml file with host component and states correctly set up:

Create Custom Event class

Some Flex metadata attributes require qualified name of a class. Again, IDEA suggests to create class if it doesn’t exist yet. Correct base class is automatically suggested if needed. For example write following…

… and get custom event class with correct base class and constructor matching super:

Did you know how to make IntelliJ IDEA even smarter? Your feedback is welcome in our forum and issue tracker.

P.S. Some features (like creating Flex Skin) are already available in IDEA 10.0.2 release, others (like creating custom event class) will be available in upcoming IDEA 10.x update release.

Comments below can no longer be edited.

7 Responses to Create Flex Skin, custom Event and other classes easily

  1. Avatar

    nirth says:

    February 21, 2011

    That would be nice, if methods toString and clone():Event, would automatically regenerate from Constructor for Custom Events.

  2. Avatar

    Taras Tielkes says:

    February 22, 2011

    On the subject of “Create From Usage”, there is some low-hanging fruit in YouTrack:

    Create the correct constructor from usage, instead of blindly creating a no-arg one (and then complaining to the user):

    If a class exists, but does not contain an explicit constructor, IDEA should offer to create one from usage instead of just complaining:

    For an unresolved reference in Flex code, IDEA offers no less than 8 “create from usage” QuickFixes. The most obvious and common one (creating a local variable) is not offered:

  3. Avatar

    pmac says:

    February 22, 2011

    Is there a list somewhere that details what new features are planned for the 10.x release in general?

  4. Avatar

    Alexander Doroshko says:

    February 22, 2011

    @pmac No, there’s no separate list for 10.x. The most complete list is in our issue tracker (ActionScript/Flex related issues have ‘Flex Support’ category). Which features will be implemented first depend on user feedback (votes, comments etc.)

  5. Avatar

    Daniel Alves says:

    October 19, 2011

    In my opinion the intellij is just great for coding in flex, but the editor has some problems yet:

    1) It does not support the Metadata tag for defining custom events in MXML components;

    [Event(name=”submit”, type=””)]
    [Event(name=”cancel”, type=””)]
    [Event(name=”beforeSubmit”, type=””)]

    2) It does not support properties defined in MXML components, like:


    public var validators:Array = new Array();


    The validator property is not recognized. But this error appears to be randomly. For some properties it happens, others don’t.

  6. Avatar

    Alexander Doroshko says:

    October 21, 2011

    > 1) It does not support the Metadata tag for defining custom events in MXML components
    I’m afraid I don’t understand the problem. This blog post shows that IDEA does understand custom events. Do you have incorrect code highlighting somewhere? Can you please provide details and create respective issue:
    > 2) It does not support properties defined in MXML components
    Again, we need full code sample to reproduce the issue, preferably in issue tracker.

  7. Avatar

    flex developer says:

    November 24, 2011

    I haven’t tried it. I am very happy to learn new things such flex skin creation. Thank for sharing such grate information. (

Discover more