23
Mon, Dec
3 New Articles

Weaving WebSphere: Eclipse Plugs In

Development Tools
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times
No quotation this column. The word "plug-in"--and even "plug"--just doesn't seem to generate the level of creative wordplay required for a good, pithy quote. After my research led to a particularly unpleasant bit of doggerel by William Dewitt Snodgrass, I decided to pass on the idea altogether.

So let's just move right on to the subject, shall we? The Eclipse IDE is, as the Eclipse consortium is fond of saying, an IDE for anything and nothing in particular. As I pointed out in an earlier article, Eclipse as shipped isn't much good for anything but organizing text documents.

That's because the idea behind Eclipse is that third-party developers will create "plug-ins," modular pieces of software that can be attached (plugged into) the existing IDE framework. As of this writing, there are 194 plug-in projects in various stages of development. Remember, though, this is the land of open source, which means that there's a good chance that many of those projects will wither and die before reaching any sort of usable fruition.

That's not to say that no plug-ins will ever be created. In fact, you can go to the Eclipse site today and download a build of Eclipse that contains two full-featured plug-ins: the Java Development Tooling plug-in and the somewhat recursive Plug-in Development Tooling plug-in. The former is the JDT, which I compared to Visual Age for Java in my most recent article, while the latter, the PDT, is used to create your own plug-ins. Not only that, but much of the new WebSphere Studio product line--including the WebSphere Studio Site Developer advanced (WSSDa), the WebSphere Studio Application Developer (WSAD), and the latest version of the WebSphere Development Studio client (WDSc)--are actually sets of very powerful plug-ins to Eclipse.

So, if you plan on following IBM's lead into the brave new world of Eclipse-based development, it's important that you understand what plug-ins are and what they mean to you. In this article, I'll cover three high-level concepts:
  • The pieces of a plug-in: views, actions, and editors
  • Perspectives: how Eclipse sees itself
  • Features and what they do

The Pieces of a Plug-In

In order to understand the concept of a plug-in, you should understand the various pieces that make up a plug-in. It's important to know that these pieces are optional--no one plug-in needs all of these pieces. In fact, most plug-ins use only a subset of the available plug-in components. Figure 1 shows views, actions, and editors, which are some of the more common aspects of a plug-in.

http://www.mcpressonline.com/articles/images/2002/021229%20-%20Eclipse%20Plug-insV300.png

Figure 1: The three most common parts of a plug-in are views, actions, and editors.

A view is a customized list of objects. One of the primary views is the "navigator" view, which is usually used to access all the objects in a coherent manner. For example, in the PDT, the view includes the Java source and classes, the required .jar files, the icons and HTML help files, and the XML files that configure the plug-in. By using the navigator view, you can move from one object to another.

Each view has actions. These actions appear in a toolbar at the top of the view. However, the objects in the view (especially the navigator view) also have context-specific actions accessible through a pop-up menu. It is up to the plug-in designer to populate these menus as appropriate. This includes identifying which actions make sense when multiple objects are selected. Actions can be anything from adding or deleting an object to changing an object's properties. But the fundamental option for an IDE, the one service we need the IDE to provide, is editing.

And that's where editors come in. Typically, an object-aware editor is invoked whenever you ask to edit an object. There are many variations of the simple editor. Read-only editors are possible, though obviously of limited usefulness. Brain-dead generic text editors can be used. And while these editors don't do much for productivity, they at least handle those files for which we have yet to design the special-purpose editors. And those special purpose editors are the cream of the crop. With Eclipse, the bulk of the special purpose editing is supposed to be done by the LPEX editors. So far, I think they do an adequate job. I'll follow up that subjective opinion with more facts in a later article.

There are other optional parts to a plug-in as well. A wizard is probably the one you are most likely to use. Wizards allow you to walk a user through the configuration of an action step by step using dialogs. This is most effective for things like "New" actions, where the user is creating a new object. Also, you can create preferences pages that allow the user to define global values that will persist from one session to the next and that change the way the plug-in operates. Finally, for objects with complex properties, you can specify property pages that function a lot like wizards to allow you to dynamically update those properties without having to write a lot of customized UI programming.

It's important to note that some "standard" views come along with the IDE. For example, the tasks view and the properties view are always available (I'll explain more about that in the Perspectives section) and should probably operate the same way in your plug-in as they do in other plug-ins. This sort of consistency from one view to the next is a way to reduce the learning curve for your plug-in. Your actions should also follow consistent naming conventions--"Open" rather than "Edit," for example, or "Browse" for read-only access. (National language support is also present, but it's a little too much to fit into this introductory article.)

Perspectives

So now we have all these pieces to plug in. What exactly do we plug them in to? Good question...the answer is "a perspective." And, more often than not, the answer is "an existing perspective."

So what is a perspective? In simplest terms, a perspective is a collection of views. The perspective identifies the views that are available to the user. Some perspectives are shipped with the product or with features (see the Features section below). Perspectives have a default layout that is used the first time the perspective is opened (you can also reset a perspective back to its default layout). When a plug-in adds a new view, it adds it to the general population of views, but it may also add it specifically to the default layout of an existing perspective. This requires that the plug-in designer know the layout of the perspective and that the layout is fairly static. Not only that, but adding to the default layout may not do much good, since one of the primary features of Eclipse is the ability for users to customize the layout of their perspectives and even to create new ones of their own.

The following figures show how easy it is to configure your own perspective.

http://www.mcpressonline.com/articles/images/2002/021229%20-%20Eclipse%20Plug-insV301.png

Figure 2: Adding a view to a perspective is as easy as selecting it from the pulldown menu.

By using the Window/ShowView option, you can add any of the available views to your current perspective. It will add the view to a default location on the page. However, you aren't limited to that location.

http://www.mcpressonline.com/articles/images/2002/021229%20-%20Eclipse%20Plug-insV302.png http://www.mcpressonline.com/articles/images/2002/021229%20-%20Eclipse%20Plug-insV303.png

Figure 3: Moving a view is as easy as dragging and dropping it.

As you can see in Figure 3, you can just drag and drop the view from one pane to another. You can also resize--or even split--the panes. And once you've arranged your layout to your liking, you can save it as your own new, custom perspective.

The perspective also filters the objects viewed. For example, you might have four projects. When Eclipse comes up, it normally shows all of those projects in the default perspective, but you can easily open a new window by right-clicking on a project and selecting the Open in New Window option. A new window will open up that shows only that particular project. The same perspective is being used, but now it includes only objects for the specified project.

So, with views and perspectives, it is easy to imagine how you might be able to build what amounts to your own IDE by simply combining the appropriate panes on your display. As more and more third-party plug-ins become available, you'll find that you can add a search engine in one pane and a COBOL editor in another. There are only two drawbacks to this scheme:

1) The third-party options don't always work and play well with one another. Sometimes, you won't be able to add an object to a project because it's not the right type. While I guess I can understand the reasoning, I'd still like the ability to combine objects the way I want to, not the way the developers see fit. I think this will become even more of an issue with cross-platform development projects.

2) The second issue is a problem more for consultants than for full-time employees. Consultants will probably become comfortable with their own perspectives and may find themselves having some difficulties at different shops, which may not have the same plug-ins installed. This is not unlike the issue of customizing your keyboard. You do it at your peril.

Features

Finally, there's the concept of a feature. A feature is a set of related plug-ins that can be thought of as loosely analogous to a "product." While not particularly remarkable in its own right, the feature concept has been taken to a very nifty level by Eclipse. Features can identify "update URLs," which can then be accessed to find the latest and greatest version of the feature. When a newer version becomes available, the Update Manager perspective can be used to download the new version and install it. Not quite as automatic as the Windows Update, but still pretty nice.

So How Hard Is It?

To be honest, it's a little daunting to create plug-ins. Because the PDT comes with a really robust set of wizards, it's relatively easy to create a simple plug-in. However, mastering the intricacies of a truly useful plug-in is going to take more than just a couple of spare weekends.

Even the simplest questions--such as whether to create your own perspective, and if so, how to do that--are quite complicated. I've spent days and days slogging through the documentation, and there really isn't a lot out there for the neophyte. You'll probably have to do like I did and use the old tried and true method of starting with a working example. Then, change things and see what you break. One of the problems is that the debugging capabilities of the JDT aren't quite up to snuff with VAJ (in particular, it doesn't handle unexpected exceptions very well), so it's a little harder to learn, especially in those initial stages when you don't know enough to know what you need to learn.

Conclusions

Ah, the conclusions section of the article. Well, my conclusion is that the framework for plug-ins is very robust and flexible. This is often programmer doublespeak for "very complicated," and in this case, it's true. The APIs for designing Eclipse plug-ins are complex and often hard to understand. Creating a plug-in is not for the faint of heart, and my guess is that any of us who tries is going to spend a lot of time on the "error" side of "trial and error."

I think the amount of flexibility available will make it easy to over-engineer our first attempts, but eventually I think a sort of "standard" for plug-ins will begin to develop. Until then, those on the bleeding edge of plug-in development are likely to get very bloody indeed.

But the more appropriate issue is whether you'll need to create plug-ins at all. You may want to look at some of the existing plug-ins to see what makes sense. In the long run, you may be better off simply downloading a plug-in or two and then configuring your own perspective. This is where the product will shine. Because you'll be able to add new plug-ins whenever they become available, it's unlikely that you will outgrow Eclipse for some time. And as the industry evolves and more new technologies emerge, Eclipse will be able to keep up with them.

So, my conclusion? As a developer, you're going to have to learn this tool. Will software vendors need to write their own plug-ins? That's going to depend very much on consistency and market acceptance.

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. He has been working in the field since the late 1970s and has made a career of extending the IBM midrange, starting back in the days of the IBM System/3. Joe has used WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. Joe is also the author of E-Deployment: The Fastest Path to the Web. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: