Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Поиск рулит! Сообщения за день Все разделы прочитаны
 

Вернуться   Форум Flasher.ru > Flash > Flex

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 05.06.2008, 14:34
moron вне форума Посмотреть профиль Отправить личное сообщение для moron Найти все сообщения от moron
  № 1  
Ответить с цитированием
moron
 
Аватар для moron

Регистрация: Feb 2008
Адрес: Russia
Сообщений: 19
Question Собственная папка для компонента в панели Сomponents

(Flex Builder 3 --> панель Components)
По умолчанию, Flex Builder все собственные(не встроенные) компоненты помещает в папку "Custom".
Хочу сделать так, чтобы мой компонент помещался в какую-нибудь другую папку, например "MyProjectComponents".
Можно ли это сделать и как?
...
Перекопал хелпы по свик-библиотекам, метадате и манифест-файлам для compc -- узнал много чего интересного, но то что надо не нашёл
__________________
lida -- dyra (c) lida


Последний раз редактировалось moron; 05.06.2008 в 14:46.
Старый 05.06.2008, 23:25
ex.image вне форума Посмотреть профиль Отправить личное сообщение для ex.image Найти все сообщения от ex.image
  № 2  
Ответить с цитированием
ex.image

Регистрация: Jan 2006
Адрес: Москва
Сообщений: 65
Отправить сообщение для ex.image с помощью ICQ
Если найдешь отпишись плиз )) тоже исчу
__________________
Бубен - волшебный инструмент программирования.

Старый 09.06.2008, 11:40
moron вне форума Посмотреть профиль Отправить личное сообщение для moron Найти все сообщения от moron
  № 3  
Ответить с цитированием
moron
 
Аватар для moron

Регистрация: Feb 2008
Адрес: Russia
Сообщений: 19
Наконец-то выкопал
Ресурс: http://sudhahariharan.wordpress.com/...lex-builder-3/

When my team lead first told me about this, I had no idea what I had to do about it. Ofcourse, the first step was to depend on good old Google, but this time Google ditched me. I hardly found any good results nor did I get good replies from the various forums we have dedicated to Flex. All I could find was this bug in the bug database.

After a lot of help from various people, this is the information that I could gather about the files manifest.xml and design.xml.

To customize the Design view of Flex Builder for specific components we essentially need the above two files. As an example, if you want to have components to be listed under specific categories instead of the default behavior of Flex Builder that puts them under the custom tag, you could do the following.

Have an XML file called design.xml that has a structure similar to

Код:
<?xml version=”1.0″ ?>

<design>

<namespaces>

<namespace prefix=”myExample” uri=”http://demo.sap.com” />

</namespaces>

<categories>

<category id=”TestComponents” label=”TestComponents” defaultExpand=”true” />

</categories>

<components>

<component name=”TestButton” namespace=”demo” category=”TestComponents” displayName=”Test Button”>

<mxmlProperties>

</mxmlProperties>

</component>

</components>

</design>
As seen in the above example, you can define various categories inside the <categories> tag and later define components within <components> tag and map these components to their appropriate categories. You would do that simply by adding an attribute called category inside the <component> tag. The <namespace> defined here would be the same as the namespace that is created when you add the component to the application (drag and drop the component in design mode and you could find the namespace created for you in source mode).

The manifest file basically defines what components would be present in the swc you are creating. For example, if I have only one component called TestButton in my library I would write a manifest.xml file

Код:
<?xml version=”1.0″ encoding=”UTF-8″ ?>

<componentPackage>

<component class=”com.test.components.TestButton” id=”TestButton” />

</componentPackage>
The component tag defines the package name where in the class is defined.

By doing the above, I was able to have a customized component view.

One thing worth a mention is the tag called <mxmlProperties> within the design.xml file. This is useful if you want to show certain properties in the Flex Builder Standard Properties view. For example,

Код:
<mxmlProperties>

<textfield id=”title” name=”Title:” />

<combo id=”showTitleBar” name=”Title Bar:”/>

</mxmlProperties>
The above lines would create a textfield and a combo box displayed as Title: and Title Bar: respectively in the Standard Properties view. You can also add default values to this property simply by including

Код:
<defaultAttribute name=”showTitleBar” value=”false”/>
This line would give the default value as false for the combo box displaying as TitleBar.

Certainly, this is only very little of what one could do with these two files and Customizing Flex Builder without having to build any additional plugins. I wish there were many more blogs and some documentation that could throw some light onto this area.
__________________
lida -- dyra (c) lida


Последний раз редактировалось moron; 09.06.2008 в 11:43.
Старый 09.06.2008, 12:29
moron вне форума Посмотреть профиль Отправить личное сообщение для moron Найти все сообщения от moron
  № 4  
Ответить с цитированием
moron
 
Аватар для moron

Регистрация: Feb 2008
Адрес: Russia
Сообщений: 19
Library Projects and Customization in Flex Builder 3.

Для того, чтобы переделать Design View во Flex Builder 3 под собственный компонент/библиотеку нужны следующие файлы: manifest.xml и design.xml.
К примеру, если вы хотите, чтобы компоненты отображались в отдельных категориях, а не в папке "Custom", в которую билдер помещает компоненты по дефолту:

Нужен XML-файл с именем design.xml с примерно следующей структурой:

Код:
<?xml version=”1.0″ ?>
<design>
     <namespaces>
          <namespace prefix=”myExample” uri=”http://demo.sap.com” />
     </namespaces>
     <categories>
          <category id=”TestComponents” label=”TestComponents” defaultExpand=”true” />
     </categories>
     <components>
          <component name=”TestButton” namespace=”demo” category=”TestComponents” displayName=”Test Button”>
               <mxmlProperties>
               </mxmlProperties>
          </component>
     </components>
</design>
Как видно из примера выше, можно определять различные катагории в тэге <categories> и затем определять различные компоненты внутри тега <components> и сопоставлять их с соответствующими категориями. Сопоставление осуществляется с помощью аттрибута category внутри тега <component>. Названия пространств имён, определённые в теге <namespaces> будут автоматически подставляться в рутовый тег, когда вы перетаскиваете свой компонент на сцену из панели "Design".

Файл manifest.xml по существу определяет какие компоненты будут представлены в создаваемом вами swc-файле.
К примеру, если у меня в библиотеке есть только один компонент с именем "TestButton", файл manifest.xml будет следующим:

Код:
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<componentPackage>
     <component class=”com.test.components.TestButton” id=”TestButton” />
</componentPackage>
Тэг <component/> определяет пакет, в котором находится нужный компонент.

Ещё одна вещь, о которой следует сказать, это тег <mxmlProperties> в файле design.xml. Он нужен для того, чтобы в панели Flex Builder Standard Properties view отображались особенные свойства.
К примеру:
Код:
<mxmlProperties>
     <textfield id=”title” name=”Title:” />
     <combo id=”showTitleBar” name=”Title Bar:”/>
</mxmlProperties>
Вышеприведённые строки создадут в панели "Flex properties" в режиме "Standard view" текстовое поле и комбо-бокс с надписями "Title:" и "Title Bar:" соответственно. Также можно задавать значения по умолчанию для свойств примерно так:
Код:
<defaultAttribute name=”showTitleBar” value=”false”/>
Эта строка задаст начальное значение "false" для комбо-бокса с надписью "Title Bar:".

На данный момент более подробной информации найти не получилось, будем надеяться что компания "Adobe" в скором времени осветит эти вопросы более подробно.
__________________
lida -- dyra (c) lida

Создать новую тему Ответ Часовой пояс GMT +4, время: 02:33.
Быстрый переход
  « Предыдущая тема | Следующая тема »  
Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 02:33.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.