Skip navigation
mmmmins
Currently Being Moderated

One extension with multiple panels

Aug 28, 2012 5:26 AM

Hello everybody,

 

I am trying to find out if there is an option to have more than one panel per extension. The idea is to have a behaviour like different tabs, but instead of using the "tab" option within one panel, being able of displaying them as separate panels, so the user can see two (or more) of them at the same time.

 

I found this, but this would install two extensions in one go that can work together, but what I would like to see is only one extension.

 

Thanks a lot,

 
Replies
  • Currently Being Moderated
    Sep 6, 2012 6:05 AM   in reply to mmmmins

    import com.adobe.csxs.core.CSInterface;

    import com.adobe.csxs.types.CSXSWindowType;

    import spark.components.Window;

     

    private function createNewPanel():void

    {

         var nPnl:Window = new Window;

         nPnl.type =  CSXSWindowType.PANEL;

         // nPnl.x =

         //nPnl.y =

         //nPnl.width =

         //nPnl.height  =

         //nPnl.addElement()

         nPnl.open();

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2012 12:34 PM   in reply to mmmmins

    No can do... Sorry.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2012 2:38 PM   in reply to mmmmins

    mmmmins wrote:

     

    I am trying to find out if there is an option to have more than one panel per extension. The idea is to have a behaviour like different tabs, but instead of using the "tab" option within one panel, being able of displaying them as separate panels, so the user can see two (or more) of them at the same time.

     

    It is possible to ship one "bundle" that contains multiple extensions. Typically people only create one extension per bundle, so there is some blurring of the terms - often when we talk about extensions we're really talking about bundles. When you create a new extension in Extension Builder what you're really doing is creating a new bundle with one extension in it. The article you linked to is an example of creating a bundle with two extenions in it. If you look at the CSXS manifest XML file you'll see the ExtensionList and DispatchInfoList elements - these can contain multiple Extension tags. This is supported by all the point products that support CSXS panels, indeed there are a number of Adobe bundles made up of multiple extensions.

     

    mmmmins wrote:

     

    I found this, but this would install two extensions in one go that can work together, but what I would like to see is only one extension.

     

    Thanks a lot,

     

    What do you mean by "only one extension"? Do you mean you only want the user to have to install one extension? Even if your bundle contained two extensions the user would only have to install one ZXP. If you mean that you only want one menu item to appear under Window > Extensions, then that would be possible by only having a menu item for one of the extensions. You could then open the other extension on creationComplete or some other start up event using CSXSInterface.getInstance().requestOpenExtension(<second extension's id goes here>);. You could send messages between the two panels using CSXS events.

     

    Hope that helps,

     

    Louis

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 10, 2012 11:42 AM   in reply to mmmmins

    Huh? Did you actually try this?

    I don't think it will work...

     

    (referring to creating the panel on the fly...)

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 11, 2012 6:09 AM   in reply to mmmmins

    Interesting. Which version(s) did you try this in?

     

    IIRC, last time I tried to create a panel on the fly it created a regular window. I don't remember which apps/version I tested in.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 11, 2012 6:14 AM   in reply to Harbs.

    I just tested in InDesign CS6 and it creates a palette -- not a dockable panel. Are you sure PS is different?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2012 1:42 AM   in reply to Harbs.

    I am sorry for my bad English...

     

     

    I see that my code caused some interest, and for this reason, I will add some explanations:

    This code was written on Flash Builder 4.6 with ExtBuilder 2.0 for Dreamweaver CS6 (Win). Result of execution of a code - is "native" floating panel created in real time.

    The created panel allows to add \ delete the elements UI (before call open(), and after that) to work with events etc......  shortly, it is typical spark.panel or TitleWindow.

    Created panel has the added internal Id (using in dreamweaver)

    equal ExtensionId + sequence number of the created panel, for example: com.figgaz.dw.testExt0

    Further, on this Id it is possible to address from ExtendScript script.

     

    By the way, in DW I couldn't catch an event of close and closing if the panel closed by button [x]. But яашёл an output through ExtendScript:

     

    var result:Boolean = CSInterface.instance.evalScript ('dw.getFloaterVisibility("com.figgaz.dw.testExt0")') as Boolean;

    result = false if a panel is closed

                                       and

    result = true if panel is open.

     

     

    Harbs. wrote:

     

    I just tested in InDesign CS6 and it creates a palette -- not a dockable panel. Are you sure PS is different?

    I didn't test this code in other applications of CS (while) also I can't know his behavior in them in any way.

    But I remember that i slightly read about it in one of documentation.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 7, 2012 4:26 AM   in reply to mmmmins

    Here's the results of my testing:

    1) Dreamweaver: Works.

    2) Fireworks: Does not work.

    3) Flash: Opens palette instead of panel.

    4) Illustrator: Works

    5) InDesign: Opens palette instead of panel

    6) Photoshop: Works

     

    I don't have video apps onstalled to try it on.

     

    So, if you need it for DW, PS or AI, it's viable. Otherwise, no.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2013 2:10 AM   in reply to FIGGAZZ

    Hello,

     

    I have created new panel with your code, but I cant figure out how will that panel receive events from the Extension. Kidly help.

     

    Thanks.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2013 2:50 AM   in reply to Hitz_M

    The strategy I have used in the past is to use CSXS events to communicate between the two panels. E.g. if your main panel is called "PanelA" and your secondary panel is "PanelB" then you might have something like this in the code for PanelB:

     

    private function onCreationComplete():void

    {

        CSInterface.instance.addEventListener("com.example.panelA_to_panelB_e vent", respondToCSXSEvent);

        // For CS5/5.5 you would use CSXSInterface.instance instead of CSInterface.

    }

     

    You can then contact it from PanelA by dispatching a CSXS event with type "com.example.panelA_to_panelB_event". You could have similar listeners in the PanelA code for two-way communication.

     

    Hope that helps,

     

    --Louis

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 9, 2013 2:53 AM   in reply to lomorgan

    Thank you. Will try it out.

     

    Regards,

    Hitesh

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2013 7:26 AM   in reply to Harbs.

    I am facing a problem while changing UI Theme in Illustrator.

    I have 2 panels, PanelA created by the extension and PanelB created using the code above through the extension.

    Both have mx:TabNavigator in them.

    In PanelA, the TabNavigator is added through mxml and in PanelB through ActionScript

    within the extension i've CSInterface.instance.autoThemeColorChange = true;

     

    while changing Illustrator theme from Dark to Light, the color of tabnavigotor for PanelA changes but not for PanelB

     

     

     

     

     

     

    Kindly help.

    Thanks

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points