Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By : Alex Blewitt
Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By: Alex Blewitt

Overview of this book

Eclipse is used by everyone from indie devs to NASA engineers. Its popularity is underpinned by its impressive plug-in ecosystem, which allows it to be extended to meet the needs of whoever is using it. This book shows you how to take full advantage of the Eclipse IDE by building your own useful plug-ins from start to finish. Taking you through the complete process of plug-in development, from packaging to automated testing and deployment, this book is a direct route to quicker, cleaner Java development. It may be for beginners, but we're confident that you'll develop new skills quickly. Pretty soon you'll feel like an expert, in complete control of your IDE. Don't let Eclipse define you - extend it with the plug-ins you need today for smarter, happier, and more effective development.
Table of Contents (24 chapters)
Eclipse Plug-in Development Beginner's Guide Second Edition
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating a nature


A nature is created by implementing the IProjectNature interface. This will be used to create a MinimarkNature class, which will allow projects to be associated with the MinimarkBuilder class.

  1. Create a class called MinimarkNature in the com.packtpub.e4.minimark.ui package as follows:

    public class MinimarkNature implements IProjectNature {
      public static final String ID =
       "com.packtpub.e4.minimark.ui.MinimarkNature";
      private IProject project;
      public IProject getProject() {
        return project;
      }
      public void setProject(IProject project) {
        this.project = project;
      }
      public void configure() throws CoreException {
      }
      public void deconfigure() throws CoreException {
      }
    }
  2. The purpose of a nature is to assist by adding (or configuring) the builders, which are associated by an ID. To make cross-referencing possible, define a constant in the MinimarkBuilder class, which can be used to refer to it by the nature:

    public class MinimarkBuilder extends...