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,
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();
}
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
lomorgan wrote:
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
I was refering to not having two extensions in the menu, the option of creating a bundle with different extensions looks like the best option! Thank you for this great explanation!
FIGGAZZ wrote:
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();
}
After having a look at the code and implemented in my extension, this could really make it. I still need to decide whether to go for a bundle of extensions with only one in the menu or this other option you suggest. Thanks a lot!
I did try this (with some modifications for my extension) and did create a panel on the fly indeed... I myself didn't add any content to the panel, but the new panel was created and emerged in Photoshop.
Harbs. wrote:
Huh? Did you actually try this?
I don't think it will work...
(referring to creating the panel on the fly...)
It does launch a new panel that can be docked around...
import mx.core.Window;
import com.adobe.csxs.core.CSXSInterface;
import com.adobe.csxs.types.CSXSWindowType;
public function appComplete():void{
var nPnl:Window = new Window;
nPnl.type = CSXSWindowType.PANEL;
nPnl.open();
}
I didn't really add content to it though!
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.
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.
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
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
North America
Europe, Middle East and Africa
Asia Pacific