UI designer basics. Work with pallet and dependencies

Hello.

Some time ago I started work with ui designer. But there is no javadoc there, and it's very hard to understand what for is that class or  method.
So, I have a several questions, to ask for:

1) How to depend on some plugin correctly. What else i need to do, but put

<depends>com.intellij.ui-designer-new</depends>

in my plugin.xml? Now, I'm included ui-designer module in my project, but I'm still uncertain, is it right. (see below)

2) It looks, like I'v done something wrong in previous point. PaletteToolWindowManager isn't initialised, never constructed. "Palette" in Tool window in View->Toolwindow is disabled(grayed).
Yes, i'm sure, that I registered my own FileEditorProvider and DesignEditor correctly.

3) When describing my MetaManager, which parses xml, and extract properties, how can I share some properties between many meta instances? A saw something like

<meta >     <properties         important="id background"         expert="tag scrollX scrollY fitsSystemWindows scrollbars scrollbarStyle isScrollContainer fadeScrollbars scrollbarFadeDuration scrollbarDefaultDelayBeforeFade scrollbarSize scrollbarThumbHorizontal scrollbarThumbVertical scrollbarTrackHorizontal scrollbarTrackVertical scrollbarAlwaysDrawHorizontalTrack scrollbarAlwaysDrawVerticalTrack fadingEdge requiresFadingEdge fadingEdgeLength nextFocusLeft nextFocusRight nextFocusUp nextFocusDown nextFocusForward saveEnabled filterTouchesWhenObscured drawingCacheQuality keepScreenOn duplicateParentState soundEffectsEnabled hapticFeedbackEnabled contentDescription overScrollMode translationX translationY transformPivotX transformPivotY rotation rotationX rotationY scaleX scaleY verticalScrollbarPosition layerType layoutDirection textDirection"         />   </meta>

which stores a lot of properties, but till can't understand mechanics, HOW widget, Button, for example, recognized, that it is View. ClassLoader, then Reflection? Or I missed something in tones of code there?

Will be glad for any help, links, explanations, anything.

6 comments

Hello,

Will you want write own designer?

0

Oh. It's good to see designer code author here!

Yes, my purpose is to write some GUI designer for my own xml-based ui description format. I find that reuse some designer code will be best solution. I study android-designer code, and ui-designer core. But described above moments are still unclear for me.

0

Hello,

Right now for Designer not have any documentation, I will be answered on some questions.

>1) How to depend on some plugin correctly. What else i need to do, but put
> <depends>com.intellij.ui-designer-new</depends>

>in my plugin.xml? Now, I'm included ui-designer module in my project, but I'm still uncertain, is it right. (see below)



Yes, all right.

>2) It looks, like I'v done something wrong in previous point. PaletteToolWindowManager isn't initialised, never constructed. "Palette" in Tool window in View->Toolwindow is disabled(grayed).
>Yes, i'm sure, that I registered my own FileEditorProvider and DesignEditor correctly.


In your DesignerEditorPanel implementation see to method List<PaletteGroup> getPaletteGroups() - return not empty list with palette elements.

>3) When describing my MetaManager, which parses xml, and extract properties, how can I share some properties between many meta instances?




Sorry, bot not way. For every model you will describe properties.

>A saw something like 
>which stores a lot of properties, but till can't understand mechanics, HOW widget, Button, for example, recognized, that it is View. ClassLoader, then Reflection? Or I missed something in tones of code there?


Yes, over ClassLoader, and iterate all parent classes.

0

1, 3) Thanks! Things become much more clear to me now.

2) I'm still unable to show panel.
getPaletteGroups() method have never been called.
PaletteToolWindowManager.getInstance(project) returns null.
My realisation of ViewsMetaManager.getInstance(getProject()).getPaletteGroups() returns correct-looked ArrayList result.

So, I think, problem Is somewhere in PTWM registration as component.

0
> 2) I'm still unable to show panel.

> getPaletteGroups() method have never been called.
> PaletteToolWindowManager.getInstance(project) returns null.
> My realisation of ViewsMetaManager.getInstance(getProject()).getPaletteGroups() returns correct-looked ArrayList result.


Maybe show me your project?

> So, I think, problem Is somewhere in PTWM registration as component.


DesignerToolWindow also registered as component.

0

2) Sorry, I think, it's not so easy, for some reasons.

From DesignerToolWindow, as it is described here http://www.jetbrains.com/idea/webhelp/designer-tool-window.html I see only "Designer pane".

Huh. Good, thank you. Forget it. I think, I shoud solve this problem manually.

0

Please sign in to leave a comment.