Re: Round 1 - dynamic swixml abilities..

[email protected]
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
Maybe I am just not understanding it quite yet. I
create the JFrame or Frame object myself for the
applet or application to reside in, and set that as
the frame of the SwingEngine. From there, it uses xml
to render the UI, but from what I can see it only gets
to do so with a single xml file? Worse case, I have my
plugin take ALL the xml files, combine them and pass
it as one big string or reader of xml. I would ideally
like to be able to do something like:

load plugin 1, plugin one has menubar, menuitems,
menus, etc defined. Have Swixml render it.

load plugin 2, it has menubar, menuitems, menus, etc
also defined. Have swixml now render these.

etc..

Their are two concerns. One, the menubar/menu/menuitem
name clash. What if I have 2 items all with a menu
path of /File, and two have the same Open menuitem
name, does a flyout menu get created? Or do these have
to be specifically designed? The problem I face is
that plugins are dynamic, and each deployment does not
know about any other, so there is no way to know at
compile time how many plugins may try to use the same
menupath and menuitem, although ideally menuitem names
are rarely clashed.

The second is that my ui framework should really have
only one JMenuBar in it. If menu and menuitem nodes
must appear below a menubar node, swixml wont try to
create continuous menubar objects will it? It's smart
enough to know that the menubar is already created?



--- [email protected] wrote:
> rendering a snippet of xml to append to insert into
> a container... I 
> think you want the
> insert(Reader, Container) method in SwingEngine
> 
> swixml does not keep track of the ui it's built per
> se... It does keep 
> track of the objects that have an ID though. there's
> a Hash of them in 
> there so that you can retrieve them by id.  I
> *think* it just adds the 
> listeners while it's still working with the object
> and once it's moved 
> on to the next object (unless it's the next one is a
>  child or has an 
> id) it forgets about it.
> 
> as for parsing the xml: it's jdom not xmlpull.
> 
> -Kate
> 
> 
> On Dec 24, 2003, at 4:43 PM, [email protected]
> wrote:
> 
> > Hi all,
> >
> > Ok, I have the UI plugin ready to go with using
> > swixml.jar, an extension point for plugins to
> extend
> > to get "basic" swixml usage and all is building
> and
> > running.
> >
> > So a few things I would like to say regarding my
> > framework, then some questions.
> >
> > First, I want the ability for an app to decide,
> via a
> > config file or some othe means (not yet decided)
> if it
> > is an MDI or SDI app. Because swixml has the
> ability
> > to generate applet or swing code, I am hoping to
> see
> > the ui framework I am working on to do both as
> well,
> > so if this is possible in some manner, the
> application
> > should be able to specify this as well.
> >
> > When the appshell main() is called, it should be
> able
> > to read a "core" swixml xml file to build the
> > "initial" layout, based on mdi/sdi, applet/swing,
> and
> > so forth. The "core" layout is application
> definable
> > via the swixml xml file, allowing each application
> > using my framework to decide how they wish the app
> to
> > look, as well as the core plugins to provide with
> it.
> >
> > Now here is where I am getting a little stuck. I
> need
> > each plugin to be able to specify things like menu
> > items, toolbar buttons, windows, etc. Is it
> possible
> > to give swixml a "snippet" of xml so that it can
> > render it within the already existing UI it has
> built?
> > If not, if I have something like:
> >
> > <frame id="frame" title="Swixml - Action Sample"
> > size="360,200">
> >   <menubar id="mb">
> >     <menu id="mu_file" text="File">
> >       <menuitem text="New" icon="icons/user.gif"
> > mnemonic="VK_N" Action="newAction" />
> >       <menuitem text="Open" icon="icons/open.gif"
> > mnemonic="VK_O" Action="openAction" />
> >       <menuitem id="mi_save" text="Save"
> > icon="icons/save.gif" mnemonic="VK_S"
> > ActionCommand="AC_SAVE" />
> >     </menu>
> >   </menubar>
> > </frame>
> >
> > So, let's assume the application provides its xml
> that
> > it passes on to swixml to render. It adds action
> > listeners, etc at some points. Now, plugin A wants
> to
> > add a menu item to menu File, item = "Open". Does
> it
> > also need to provide the full xml like above? Or
> can
> > it simply provide something like <menuitem id=../>
> and
> > the swixml will know that it already has built a
> > frame, a menubar and knows to use it? Does swixml
> keep
> > track of the UI it's built.. it must if it can
> > programatically add action listeners and such
> after
> > its rendered the UI.
> >
> > So, in a nutshell, I need to figure out how each
> > plugin can add "small" pieces to the UI puzzle at
> > runtime, as each plugin might be loaded long after
> the
> > application has started.
> >
> > Also, I want to "control" the window creation
> within
> > the scope of the application by using swixml. That
> is
> > to say, my swixml plugin will get first crack at
> ALL
> > plugins that wish to add UI elements by way of
> swixml
> > xml files. I don't wish to parse them myself, but
> I do
> > wish to avoid duplicate creations, such as if two
> > plugins both have <menubar ..> tags, I obviously
> don't
> > want two of the same menubars if they reference
> the
> > same menubar. More so, I would like to possibly
> > control the menubar in such a way that plugins
> might
> > use <menubar..> and no matter what they enter,
> once
> > the first menubar is created, that's it, no more
> can
> > be added.
> >
> > Incidentally, how does swixml parse the xml? My
> plugin
> > engine uses xmlpull which is extremely fast and
> very
> > small, and thus my plugin engine is only 50K in
> size.
> > With swixml being about 50K I am guessing it too
> uses
> > xmlpull?
> >
> > Thanks. Look forward to resolving these issues and
> > more soon!
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > New Yahoo! Photos - easier uploading and sharing.
> > http://photos.yahoo.com/
> >
> > _______________________________________________
> > Forum mailing list
> > [email protected]
> >
>
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com
> 
> 
> _______________________________________________
> Forum mailing list
> [email protected]
>
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.