Digital Edition

SYS-CON.TV
Sneak Peek: Tapestry Palette - My First Eclipse Plugin
Sneak Peek: Tapestry Palette - My First Eclipse Plugin

In working with Tapestry I find myself getting confused by the number of components and their parameters, even when using the excellent Spindle plugin. I haven't written an Eclipse plugin yet so I put together a plugin, building on the Spindle classes to browse the components available in my project.

The plugin adds a new view the 'Palette' to Eclipse. The image below shows the Palette on the left of the source code editor area (click on the image to see a larger view).


The Palette consists of a tree of Tapestry components, organized by namespace. Selecting a component in the tree displays a summary in the lower part of the view showing the component description and listing required and optional parameters along with their descriptions.


Once I got this far I looked into using the Palette as a source for component editing data. I reviewed the Eclipse drag and drop API and eclipse extensions for adding drag and drop functionality to existing views and editors. I was able to add drop functionality to the Spindle TemplateEditor so that dragging a component out of the Palette onto the editor inserts a <span> tag with an implicit component declaration, including attributes for required parameters at the current insertion point (you have to click in the editor at the point at which you want the component declaration to be inserted). If a range of text is selected and the dragged component allows a body the span will wrap the selection, otherwise an error dialog appears. Warning: The drop/editing code works on Linux but not on Mac OS X.

This is my first cut at the plugin, there is only minimal error checking. The Palette requires that a Tapestry project (created with Spindle) is the current project and there is at least one open source code editor in the workspace when the Palette is opened. It refreshes too often and there are some issues with resizing the view.

The plugin requires that the Spindle plugin is installed.

Download the plugin: tapestry-palette-0.01.zip

Unzip in your Eclipse install directory and restart Eclipse.

To open the Palette use the Window > Show View > Other > Tapestry > Palette menu. Make sure a Tapestry project is the current project and at least one editor window is open.



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
I'd like to add support for adding component declarations to the specification file, a wizard for setting component id and parameter values and support for inserting tags other than <span> for certain components, such as <input> tags for components representing form elements.

Many of the components, especially in the contrib library are missing descriptions and many components, have no descriptions for their parameters.

I'm working on getting the drag and drop working on Mac OS X so I can work on this on my powerbook.

About Mike Henderson
Mike Henderson is an independent consultant based in Southern California. He has been working with Java since 1999, prior to that he concentrated on Objective-C development and was a WebObjects consultant with NeXT Software. Mike has extensive experience developing Web applications with component-based frameworks and over 15 years
experience developing distributed software systems in a broad range of industries.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

The palette has matured since this article was written, visit the SourceForge site at :

http://tapestrypalette.sf.net

to see the new features. Now you can download and installTapestry component libraries via drag and drop




ADS BY GOOGLE
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE

Big Switch's mission is to disrupt the status quo of networking with order of magnitude improvements...
Lori MacVittie is a subject matter expert on emerging technology responsible for outbound evangelism...
Dynatrace is an application performance management software company with products for the informatio...
In his session at 21st Cloud Expo, Michael Burley, a Senior Business Development Executive in IT Ser...
Having been in the web hosting industry since 2002, dhosting has gained a great deal of experience w...
NanoVMs is the only production ready unikernel infrastructure solution on the market today. Unikerne...
All in Mobile is a mobile app agency that helps enterprise companies and next generation startups bu...
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO Silicon Valley 2019 will cover all of these tools, with the m...
SUSE is a German-based, multinational, open-source software company that develops and sells Linux pr...
Yottabyte is a software-defined data center (SDDC) company headquartered in Bloomfield Township, Oak...
Your job is mostly boring. Many of the IT operations tasks you perform on a day-to-day basis are rep...
Serveless Architectures brings the ability to independently scale, deploy and heal based on workload...
Technological progress can be expressed as layers of abstraction - higher layers are built on top of...
When building large, cloud-based applications that operate at a high scale, it’s important to mainta...
Whenever a new technology hits the high points of hype, everyone starts talking about it like it wil...
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the c...
"Calligo is a cloud service provider with data privacy at the heart of what we do. We are a typical ...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, disc...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (No...
Chris Matthieu is the President & CEO of Computes, inc. He brings 30 years of experience in developm...