Eclipse IDE and UML2 Getting Started Guide
CONTENTS
- Introduction to Eclipse Platform
- System Requirements
- Installation
- Installing Eclipse
- Installing Eclipse on Linux
- Installing Eclipse on Windows
- Installing UML2 Plug-in
- Installing UML2 Plug-in on Linux
- Installing UML2 Plug-in on Windows
- Getting Started
- Pre-requisites
- Using Eclipse
- Sample Example
- Some Samples
- Code Generation
The Eclipse Platform is an open source, extensible Integrated
Development Environment (IDE). It provides the framework using
which different software development tools can be integrated
under a single environment. For example, a compiler, debugger and
simulator can be integrated to provide an IDE using which, progr-
ams can be compiled and debugged. The Eclipse project provides a
Plug-in Development Environment (PDE). Plug-ins are modules which
extend the Eclipse Platform to provide specific functionality.
These can be seamlessly integrated to Eclipse at run-time.
The UML2 plug-in provides an implementation of the Unified Model-
ing Language (UML) 2.0 metamodel for the Eclipse platform. It is
based on the Eclipse Modeling Framework (EMF). The UML2 plug-in
allows specification of a system using UML and to convert the UML
model into program code.
Hardware:
- Intel Pentium IV processor based PC
- 256 MB RAM
- 40 GB Hard Disk
- CD-ROM drive
Software:
- Windows NT/XP/2000 or Red Hat Linux ES Release 3
- Java Runtime Environment v1.4.2 or higher
The following sections explain the steps involved in installing
Eclipse on Linux and Windows.
This section shows how to install Eclipse on Linux.
Step #1
Insert the Eclipse CD in the drive
Step #2
Mount the cdrom using the following command
Note: you may require super-user permissions to do this.
% mount /mnt/cdrom
Step #3
Copy the eclipse zip file under /tmp directory.
% cp /mnt/cdrom/eclipse-SDK-3.0.1-linux-motif.zip /tmp
Step #4
Unzip the Eclipse SDK file "eclipse-SDK-3.0.1-linux-motif.zip"
into a directory [INSTALL-DIR]
% cd [INSTALL-DIR]
% unzip /tmp/eclipse-SDK-3.0.1-linux-motif.zip
Here [INSTALL-DIR] is the location, where you want to install
Eclipse IDE Platform.
Step #5
Remove the zip files from /tmp directory.
% rm /tmp/eclipse-SDK-3.0.1-linux-motif.zip
Please follow these steps to install Eclipse on Windows.
Step #1
Insert the Eclipse CD in the CD drive.
Step #2
Unzip the eclipse zip file.
> cd [INSTALL_DIR]
> unzip [CD DRIVE]/eclipse-SDK-3.0.1-win32.zip
Here [INSTALL_DIR] is the location, where you want to install
Eclipse IDE Platform.
Note: The above unzip command comes with cygwin. If the cygwin has
not been installed, then install cygwin and include its bin
location in the path environment variable.
ex : path=[cygwin loc]\bin;%path%
Another alternative is install WinZIP utility, double click
the above zip file and select the [INSTALL_DIR] in the WinZIP
wizard.
Now Eclipse is available under [INSTALL-DIR]/eclipse/ directory.
This section describes the installation of the Eclipse UML2
plug-in on the Linux/Windows platform.
Please follow the below steps to install UML2 Plug-in.
Step #1
Insert the CD containing the UML2 Plugin in the CD drive.
Step #2
Mount the CD drive (if not already mounted) using the following
command.
Note: you may require super-user permissions to do this.
% mount /mnt/cdrom
Step #3
Copy EMF and UML zip files under /tmp directory.
% cp /mnt/cdrom/emf-sdo-runtime-2.0.1.zip /tmp
% cp /mnt/cdrom/uml2-SDK-1.1M2.zip /tmp
Step #4
Unzip emf-sdo-runtime-2.0.1.zip and uml2-SDK-1.1M2.zip files
into [INSTALL-DIR]/eclipse directory.
Here [INSTALL-DIR] is the directory where Eclipse is installed.
% cd $INSTALL-DIR
% unzip /tmp/emf-sdo-runtime-2.0.1.zip
% unzip /tmp/uml2-SDK-1.1M2.zip
Step #5
Remove the zip files from /tmp directory.
% rm /tmp/emf-sdo-runtime-2.0.1.zip
% rm /tmp/uml2-SDK-1.1M2.zip
Please follow the below steps to install UML2 Plug-in on Windows.
Step #1
Insert the UML Plugin CD in the CD drive.
Step #2
Unzip emf-sdo-runtime-2.0.1.zip and uml2-SDK-1.1M2.zip files
into [INSTALL-DIR]/eclipse directory.
Here [INSTALL-DIR] is the directory where Eclipse is installed.
% cd [INSTALL-DIR]
% unzip /[CD drive]/emf-sdo-runtime-2.0.1.zip
% unzip /[CD drive]/uml2-SDK-1.1M2.zip
To verify that the UML plugin has been installed successfully,
run "eclipse" program from the install directory.Then perform the
following steps:
a. Click on Help -> About Eclipse Platform.
b. Click on the Plug-In Details button.
c. Check the emf and uml plug-ins.
To use Eclipse, Java Run-time Environment (JRE) must be installed
on the system. JRE can be obtained from Sun Microsystems website:
http://java.sun.com/j2se/1.5.0/download.jsp.
From this site, either SDK or the JRE can be down-loaded.
Eclipse (v3.0) requires JRE 1.4.2 or higher.
Steps to start Eclipse IDE on Linux:
Step #1
Set the JRE binary directory to the PATH environment var.
% setenv PATH [JRE]/bin:$PATH
Here [JRE] is the location where Java virtual machine is
installed.
Step #2
Set the eclipse library path.
% setenv LD_LIBRARY_PATH [INSTALL-DIR]/eclipse:$LD_LIBRARY_PATH
Step #3
Invoke the eclipse program.
% eclipse
Steps to start Eclipse IDE on Windows:
Step #1
Set the JRE binary directory to the PATH environment var.
> PATH=[JRE]/bin;%PATH%
Here [JRE] is the location where Java virtual machine is installed.
Step #2
Invoke the eclipse program.
> cd [INSTALL_DIR]/eclipse
> eclipse
After invoking "eclipse" program, Workbench is launched.
The Workbench
When the Workbench is launched, a dialog is displayed allowing
the user to select workspace location. The workspace is the repo-
sitory where all the work will be stored. The button, OK, can be
selected for the default location.
After the workspace location is chosen, a single Workbench window
is displayed. A Workbench window offers one or more perspectives.
A perspective contains editors and views, such as the Navigator.
Multiple Workbench windows can be opened simultaneously.
Initially, in the first Workbench window that is opened, the
Resource perspective is displayed.
A shortcut bar appears in the top right corner of the window.
This allows the user to open new perspectives and switch between
ones already open. The name of the active perspective is shown
in the title of the window and its item in the shortcut bar is
highlighted.
The title bar of the Workbench window indicates which perspective
is active.
Editors and views
A Workbench consists of:
- perspectives
- views
- editors
A perspective is a group of views and editors in the Workbench
window. One or more perspectives can exist in a single Workbench
window. Each perspective contains one or more views and editors.
Within a window, each perspective may have a different set of
views but all perspectives share the same set of editors. A view
is a visual component within the Workbench.
Editors
Depending on the type of file that is being editing, the
appropriate editor is displayed. For example, if a .txt file is
being edited, a text editor is displayed in the editor area. The
name of file appears in the tab of the editor.
Views
A view can be displayed by selecting it from the Window -> Show
View menu. A perspective determines which views may be required
and displays these on the Show View submenu. Additional views
are available by choosing Other... at the bottom of the Show
View submenu.
Please refer "Getting Started with UML2" in the below site.
http://www.eclipse.org/uml2/
This section explains the necessary steps to create Use Cases,
Actors, Include relation, ans Extend relations. Other UML compon-
ents can be created in the similar way.
Steps to create Use Cases :
- Select the Model in the UML2 editor.
- Right-click and select the
New Child -> Owned Member Use Case
option from the context menu.
- Enter a value for the "Name" property in the "Properties"
view.
Steps to create Actors :
- Select the Model in the UML2 editor.
- Right-click and select the
New Child -> Owned Member Actor
option from the context menu.
- Enter a value for the "Name" property in the "Properties"
view.
- Select value(s) for the "Use Case" property in the
"Properties" view.
Steps to specify "include" relation :
- Select the Use Case in the UML2 editor.
- Right-click and select the
New Child -> include
- Enter values for "Name" and "Addition" properties in the
"Properties" view.
Steps to specify "extend" relation :
- Select the Use Case in the UML2 editor.
- Right-click and select
New Child -> extend
- Enter values for "Name" and "Extended Case" properties
in the "Properties" view.
In the same way Activity, Collaboration, State Machine, Interact-
ion and Information flow, etc can be created.
Java Source code can be generated from the model file (*.uml2).
The UML2 API does not directly support code generation. This
can be done through import wizard.
Steps to Generate Java Source Code:
- Select File -> Import
- Choose "UML2 to Ecore" and click on "Next" button
- Specify the folder and select the *.uml2 file.
- Select "Into folder"
- Click on "Finish" button
[ *.ecore file is generated. ]
- Select File -> New -> Other
- Expand "Eclipse Modeling Framework"
- Select "EMF Models" and click on "Next"
- Select the parent folder and click on "Next"
- Select "Load from an EMF code model" and click on "Next"
- Select the appropriate *.ecore file by clicking on
"Browse Workspace" button. and click on "Next" button
- Select the packages
- Click on "Finish" button.
- Select Generator -> Generate Model Core
[ src folder is created under the project directory
and it contains all *.java files ]
(C) Copyright 2005 Sankhya Technologies Private Limited
SANKHYA, SANKHYA TECHNOLOGIES, and SANKHYA Software are Trademarks, Service
Marks or Registered Trademarks of Sankhya Technologies Private Limited. All
other brands and names are the property of their respective owners.
|