SlideShare a Scribd company logo
1 of 219
Download to read offline
https://www.eclipse.org/downloads/
https://www.oracle.com/technet
work/java/javase/downloads/jdk1
3-downloads-5672538.html
Subversion(SVN)
版本控制系統
svnclient
in Eclipse
• Restart Eclipse
• Window > Perspective > Open Perspective > Other
• enter URL (SVN server and acc-pwd)
• 1. CollabNet Desktop (free)
• 2. CloudForge
3. Github (free)
http://subclipse.tigris.org/wiki/RepositoryProviders
https://app.cloudforge.com/subscriptions/new/?product=Freesource=subclipse
https://progressbar.tw/posts/3
https://github.com/join/plan
https://xken831.pixnet.net/blog/post/434388596-
%5Bjava%5D%5Bide%5D%5Beclipse%5Declipse-
svn%E5%AE%89%E8%A3%9D
After install CollabNet, restart the Eclipse
The zip file has sent to your registered email address from CollabNet.
• After connection,
click Java button
to go back to your
local site.
• go back to your local Java site
• select a Project you want to share
• Right click on the Project > Team > Share Project…
• Similar procedures as ‘import a new Project into a SVN Project…’
http://help.collab.net/index.jsp?topic=/org.tigris.subclip
se.doc/topics/new-location.html
• must specify the folder
name where you want
to store the project
• The folder name is
relative to the URL of
the repository location
you specified in the
previous step.
• All intermediate folders
must already exist in the
repository, but the final
folder name must NOT
already exist.
(e.g., ProjectName must
exist; trunk must NOT)
• You can use the
Browse... button to help
you create
(intermediate) folders.
• the convention of
storing the project in a
ProjectName/trunk
structure.
• SVN’s default folders: trunk, branches
• Files must be placed under trunk
before uploading them
• Trunk is like a root
If any error occurred, see the next slide
Files must be placed
under trunk before
commit them to a
remote platform, such
at Github
http://chrislin1015-
blog.logdown.com/posts/1
082135-svn-and-encounter-
mkcol-not-allowed-github-
upload-error-messages
• making a copy of a project from a repository into your local workspace
• In SVN, the check out process creates a working copy.
• A working copy is a specially formatted folder structure which contains
additional .svn folders that store SVN information, as well as a pristine copy of
each item that is checked out.
• Process
• navigate to
the SVN Repository
Exploring Perspective
• If an Eclipse .project file already exists in the selected repository folder, the check out
wizard will automatically default the method of checkout and using the project
definition file.
• If no .project file exists in the selected repository location, the wizard will give you the
option of checking out the folder as a regular Eclipse project or launching the New
Project Wizard.
• To select an alternative
location, uncheck the use default workspace
location option and type or Browse for a
new target location.
CBI
Common Build Infrastructure
https://www.eclipse.org/cbi/index.html
What is CBI
• Maven with the Tycho plugins
• Tycho plugins teach Maven how to build Eclipse plugins and OSGi bundles.
• This enables building Eclipse projects with “maven clean install” just as one would
build other Maven projects.
• Common services
• Jar signing facility
• MacOS signing facility
• Windows signing facility
• mature templates and common pom.xml files will be provided
• part of CBI
• Git, Hudson, the build slaves
• Nexus (aka. the artifact repository & server side of Maven)
• Gerrit, Bugzilla, and the Downloads site
• Before using tycho, create a short
sample project consisting of a small
eclipse-like product along with an
additional feature.
• Download sample project from here
https://github.com/Pontesegger/code
andme/blob/master/Code%20&%20
Me%20Blog/tycho_01_build_plugins.
zip?raw=true
• Install
Tycho
• Restart
Eclipse
http://codeandme.blogspot.com/p/tycho-articles.html
• The wizard asks for a Group Id.
• All projects that belong together will get the same Group Id.
• Use a name that represents the component you want to build.
• Artifact Id should match the Bundle-SymbolicName found in MANIFEST.MF.
• Version should be set accordingly to Bundle-Version from the manifest.
• SNAPSHOT in maven is similar to qualifier in you plug-in version.
• Packaging tells maven what type of build instructions to use.
• Set it to eclipse-plugin.
• Maven creates a pom.xml for you !
• Current version of Tycho version is
1.4.0
• Replace the codes
• Build our bundle
https://www.eclipse.org/tycho/
• Replace the codes
• property for the tycho version to be used.
• For future tycho versions you will need to upgrade this.
• the Mars p2 repository for resolving dependencies during build time.
• build section tells maven to use the tycho plug-in for the build process.
• You will see some errors/problems.
• Build our bundle
• Right click on the project → select Run As → Maven build...
• Under Goals enter clean install.
• Goals are related to the maven lifecycle. we tell maven to delete previous
build artifacts, to build our plug-in and to install build results.
http://codeandme.blogspot.com/2012/12/tycho-build-1-building-plug-ins.html
Extensions &
Extension points
https://www.vogella.com/tutorials/EclipseExtensionPoint/article.html
• Extension (contribution): contribute functionality to a certain type of API
• Contribution can be code or data
• Extension point: to define the type of API by a plug-in
• Plug-in: contains the necessary code to …
• defines extension point
• declare the extension point in its plugin.xml file
• be responsible for evaluating the extensions
• allow other plug-ins to add contributions (extensions) to the extension point.
• provides an extension (contribution) based on the contract defined by an existing
extension point
Prerequisites
• you should have basic understanding of development for the Eclipse
platform. Eclipse RCP Tutorial or Eclipse Plug-in Tutorial.
Please complete the following steps:
• 3. Install the e4 tools
• 4. Install the e4 spies
• 5. Create an RCP application with the wizard
Creating an extension point
• an XML schema file
• contains code to evaluate the extensions
Adding extensions to
extension points
modifying the MANIFEST.MF file
Accessing extensions
• After adding one extension you can right-click on it to add elements
or attributes.
• The information about the available extension points and the
provided extensions are stored in a class of type IExtensionRegistry.
• The Eclipse platform reads the extension points and provided
extensions once the plug-in is in the RESOLVED life cycle status as
defined by the OSGi specification.
• You can use the dependency injection mechanism to get the
IExtensionRegistry class injected.
Extension factories
• If you create your class directly via the IConfigurationElement class of
the extension you are limited to classes which have a default
constructor. To avoid this restriction you can use extension factories.
• To use a factory implement the interface
IExecutableExtensionFactory in the class attribute of your extension
point definition. The factory receives the configuration elements and
can construct the required object.
Exercise: create two new plug-ins
Create and evaluate an extension point
1. Creating a plug-in for the extension point definition
2. Create an extension point
Open the MANIFEST.MF file or the plugin.xml file and select
the Extension Points tab.
• The definition of the extension is generated
and the schema editor opens.
• Switch to the Definition tab.
3. Add New Element and New Attributes to the extension point.
Implement =
Interface name
This interface doesn’t exit yet. Press on the hyperlink
called Implements to create it based on the following code.
• Go back to your extension point definition and add a choice to the
extension point.
• This defines how often the extension “zkl" can be provided by
contributing plug-ins. We will set no restrictions (unbound).
4. Export the package
Select the MANIFEST.MF file switch to the Runtime tab and export the
package which contains the com.phh.expointphh.Interface.
5. Add dependencies
• Add the following dependencies via the MANIFEST.MF file of your new plug-in:
org.eclipse.core.runtime
org.eclipse.e4.core.di
6. Evaluating the registered extensions
- create a handler class which can evaluate the existing extensions.
• The code uses the
ISafeRunnable interface.
This interface protects the
plug-in which defines the
extension point from
malfunction extensions.
• If an extension throws an
Exception, it will be caught
by ISafeRunnable and the
remaining extensions will
still get executed.
• Review the .exsd schema
file and the reference to this
file in the plugin.xml file
7. Create a menu entry and add it to
your product
in the MANIFEST.MF file of
your application plug-in.
Add a dependency to the
com.phh.extpointphh plug-in
Afterwards create a new menu entry
called Evaluate extensions and
define a command and handler for this
menu entry. In the handler point to the
EvaluateContributionsHandler class.
8. Providing an extension
• Create a new simple plug-in
• Open
the MANIFEST.MF editor of
this new plug-in and select
the Dependencies tab.
• Add the
org.eclipse.core.runtime and
the plug-ins you created as
dependencies.
• Make sure your plug-in has
the This plug-in is a
singleton flag set on
the Overview tab for
your MANIFEST.MF file.
• Switch to the Extensions tab
• Select your custom extension point to Finish
• Add zkl to your extension point via right-click.
• create a class
• E.g., PhhTW
9. Add the new plug-ins to your product
com.phh.extpointphh
com.phh.extpointphh2
10. Validate
• Start your application via the product
configuration file. This updates the plug-
ins included in the run configuration.
• In your running application select your
new menu entry. The handler class write
the output of your extensions to
the Console view of your Eclipse IDE.
SWT
Standward Widget Toolkit (可移植構件工具包)
https://www.eclipse.org/swt/
an open source widget toolkit for Java
SWT Snippets
• minimal stand-alone programs
• demonstrate specific techniques or functionality
• if you are programming with JFace, you may find JFace Snippets useful
• To run a snippet
• import SWT .zip file into your workspace
• File > import …> Existing Projects Into Workspace
• create a project called org.eclipse.swt in your workspace.
• Your Java projects can then add the SWT project as a dependency.
• Open the properties dialog of your Java project
• on the Java Build Path page, include the org.eclipse.swt project.
https://download.eclipse.org/eclipse/downloads/
https://download.eclipse.org/eclipse/downloads/drops4/R-4.13-201909161045/
https://www.eclipse.org/swt/snippets/
• copy the desired snippet
(e.g., JFaceSnippets) to the
clipboard, and paste it
into a new snippet
class (under src folder).
JFaceSnippets
https://wiki.eclipse.org/JFaceSnip
pets#Snippet012_-
_Dialog_with_Image_Buttons
SWT Examples
• much larger and more
comprehensive than SWT
Snippets.
1. Install the examples
• Running the SWT Examples
inside Eclipse
• Installing the examples
• Ensure Group items by category is
unchecked.
• Type "Eclipse SDK Examples" in the
search field.
• Next > Next > accept the license
terms > Finish
• Restart Eclipse to take effect.
https://www.eclipse.org/swt/examples.php
• You may also installing
examples manually
• Download the appropriate Eclipse
SDK Example zip file from the
Eclipse project web site at
http://download.eclipse.org/eclip
se.
• Extract the contents of the zip file
to a new empty directory inside
the dropins directory of your
Eclipse installation.
• Start or restart Eclipse.
• You can verify that examples have
been installed by looking for
File > New > Example... in the
workbench menu bar.
2. Running the SWT examples
with the SWT Example Launcher
3. Running the SWT standalone
examples
Browse ... button to locate the following
directory (according to the Eclipse version and
the original installation location):
eclipse/plugins/org.eclipse.sdk.examples.source
_3.1.0/src/org.eclipse.swt.examples_3.1.0
C:Userspclabeclipsejava-2019-
09eclipsepluginsorg.eclipse.sdk.examples.source-4.13plugins
Next > Project > Add > org.eclipse.swt >
OK > Finish
• At this point your SWT examples
should be compiled without any errors.
• Check the Problems view for errors.
• If you get an error like "java.lang.Object
not found" it means you have not
configured a JRE.
• Go to the Window > Preferences ... dialog
and select the Java > Installed JREs
preference page.
• Ensure that a JRE is installed and that the
path to the JRE is correct.
• run the SWT standalone examples
• Open the Java perspective.
• In the Packages view, select the main
class that you want to run.
• Select Run > Run As... > Java
Application from the main menu.
Using OpenGL
in SWT Applications
https://www.eclipse.org/swt/opengl/
https://www.eclipse.org/swt/opengl/
https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install
JFace
you need to create a SWT Project before starting with JFace
Step 1. http://wikiict.org/java/java-swt-programming-tutorials/java-desktop-application-programming-using-swt/
note: follow the instruction of “7- Using WindowBuilder”
Step 2. download the SWT Binary and Source (see next slide, you should have installed)
Step 3. create a new plug-in project (you should know how to do it)
note: RCP Plugin Project has to be created no matter what.
http://wikiict.org/eclipse/eclipse-jface-tutorial/
copied from the previous lecture
JFace resource manager for
Colors, Fonts and Images
• SWT is based on the native widgets of the OS.
• Whenever an SWT widget is allocated, a corresponding OS specific widget is created.
• The Java garbage collector cannot automatically clean-up these OS-specific widget references.
• Fortunately all widgets which are created based on a parent widget are automatically disposed when the
parent Composite is disposed.
• If you develop Eclipse plug-ins, the Composite of a part is automatically disposed once the part is closed.
• Therefore, these SWT widgets are handled automatically in Eclipse plug-in projects.
• However, this rule does NOT apply for colors, fonts and images, as these may be reused in other places.
• For this reason, they need to be explicitly disposed.
• JFace provides the ResourceManager and its derived classes for managing such resources automatically.
• An instance of the LocalResourceManager class is created with a reference to a Control. If this Control is
disposed, the resources created by the LocalResourceManager are also disposed.
https://www.vogella.com/tutorials/EclipseJFace/article.html#jface_localresoucemanager
You should use always use a JFace ResouceManager if possible.
This avoids problems with system resources or even a "No more handles" SWTException.
• create a Package
• copy and paste an
image
• create another
Package to test
how SWT manage
data sources
(color, font, image)
and how JFace
manages
how SWT manage
data sources
• A class SWTResourceManager is automatically created.
• It is a class with utility methods for managing image, Font, Color.
You may change the title “SWT Application”
e.g., “Rsdemo Application”
Go to Properties > text in the Design tab
• You may also change
the foreground and
font style.
Then, see the code is generated from Source tab for the
class which was the one automatically generated when you
create a Package to test JFace RS (resource) manager
• Please read those codes…and try to understand how/what they work/do
Using Decoration control
• The ControlDecoration class allows you to place image decorations on SWT
controls to show additional information about the control.
• These decorations can also have a description text which is displayed once
the user places the mouse over them.
• During the layout of your screen you need to make sure that enough space
is available to display these decorations.
• For example, to highlight a Text field requires input
1. create a Package as the way how you create SWT Application (File > New > Other… >
WindowBuilder > SWT Designer > SWT > Application Window)
2. go to Design tab
3. add a Text field
add ControlDecoration from JFace
(see next two slides)
4. go to Source tab
add the codes
http://wikiict.org/eclipse/eclipse-jface-tutorial/ to copy the codes
https://www.vogella.com/tutorials/EclipseJFace/article.html#controldecoration
Q1. How to re-allocate the Text field ?
Q2. How to input from Right ?
Answers are in the next slide !!!
A: SWT Widgets
Q1. Layouts > Grid >
Q2. Properties > Style >
Note: Widgets can
contain other widgets
(container)
http://wikiict.org/java/java-swt-programming-tutorials/java-
desktop-application-programming-using-swt/
You can view the demo of the
Control at the link below, it’s
RWT (RAP Widget Toolkit)
Control, but they are essentially
the same as SWT control.
http://rap.eclipsesource.com/de
mo/release/controls/
JFaceSnippets
• Select one snippet
• The header section of each snippet is a link to the plain source.
• Copy the source and then Paste it directly on the src folder or package
in an eclipse project.
• The package and the class will be created automatically.
• Run the snippet as Java Application
https://wiki.eclipse.org/JFaceSnippets
Visual explanation
https://wiki.eclipse.org/JfaceSnippets/Instructions#Copy_Paste
If cannot Run,
check
MANIFEST.MF to
add more
dependencies
SWT Widget
http://wikiict.org/java/java-swt-programming-tutorials/java-desktop-application-programming-using-swt/
SWT widgets are located in the packages
org.eclipse.swt.widgets and
org.eclipse.swt.custom.
Preparation
• Maker sure WindowBuilder has been installed
• Create RCP Plugin Project: File > New > Other…
• Add swt library: MANIFEST.MF > Dependencies > Add
org.eclipse.swt
org.eclipse.swt.win32.win32x86_64
• SWT snippets
https://www.eclipse.org/swt/snippets/#browser
copy and paste the desired snippet into a new snippet class (under src folder).
Method 1:
• Window > Perspective > Open Perspective >
Java
• File > Import... > Plug-in Development >
Plug-ins and Fragments > Next
Method 2:
• Open page
http://download.eclipse.org/eclipse/downloads/#La
test_Release in your web browser
• go to the latest release build
• find the SWT Binary and Source
• Download zip file for your platform
(e.g., swt-4.4.2-win32-win32-x86_64.zip)
• do NOT extract the zip file
• File > Import …
• select Existing Projects into Workspace
• click Next
• specify the archive file you downloaded
• click Finish
SWT (standard) layout classes
• in the SWT library are:
• FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row
or column. It does NOT wrap, and you canNOT specify margins or spacing.
https://youtu.be/RmGN7DPCRZc
• RowLayout – more commonly used for its ability to wrap, and for its configurable
margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing
options. The height and width of each widget in this layout can be specified by
setting a RowData object into the widget using setLayoutData.
https://youtu.be/NzNiQijx96g
• GridLayout – the most useful and powerful of the standard layouts, but it is also the
most complicated. It lays out widget children of a Composite in a grid. It has a
number of configuration fields (just like RowLayout), the widgets it lays out can have
an associated layout data object, called GridData.
https://youtu.be/vun90MHAGJc
SWT (standard) layout classes
• in the SWT library are:
• FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row
or column. It does NOT wrap, and you canNOT specify margins or spacing.
https://youtu.be/RmGN7DPCRZc
• RowLayout – more commonly used for its ability to wrap, and for its configurable
margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing
options. The height and width of each widget in this layout can be specified by
setting a RowData object into the widget using setLayoutData.
https://youtu.be/NzNiQijx96g
• GridLayout – the most useful and powerful of the standard layouts, but it is also the
most complicated. It lays out widget children of a Composite in a grid. It has a
number of configuration fields (just like RowLayout), the widgets it lays out can have
an associated layout data object, called GridData.
https://youtu.be/vun90MHAGJc
wrap?
pack?
justify?
Which one better?
SWT (standard) layout classes
• in the SWT library are:
• FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row
or column. It does NOT wrap, and you canNOT specify margins or spacing.
https://youtu.be/RmGN7DPCRZc
• RowLayout – more commonly used for its ability to wrap, and for its configurable
margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing
options. The height and width of each widget in this layout can be specified by
setting a RowData object into the widget using setLayoutData.
https://youtu.be/NzNiQijx96g
• GridLayout – the most useful and powerful of the standard layouts, but it is also the
most complicated. It lays out widget children of a Composite in a grid. It has a
number of configuration fields (just like RowLayout), the widgets it lays out can have
an associated layout data object, called GridData.
https://youtu.be/vun90MHAGJc
drag to merge cells
SWT StackLayout
• stacks all the controls one on top of the
other and resizes all controls to have the
same size and location.
• topControl is visible and all other
controls are not visible.
• Users must set the topControl value to
flip between the visible items and then
call layout() method on the composite
which has the StackLayout.
• Be Local
• Be Field
Modular component interfaces
TopComposite
BottomComposite
ma
MainComposite
Similarly add
BottomComposite to
“My Composite” catalog.
• Similarly, create class
BottomComposite
• Similarly create class
MainComposite:
drag and drop to the main
Finally, create a Java app by
using the main composite !
• Analysis of window.title
JFace Viewer (makes coding life easier when creating Tables)
• allows you to display a domain model in a standard SWT widget
• E.g., list, combo, tree or table
• without converting the domain model beforehand.
• allows you to set a content provider which provides the data for the viewer
and makes no assumption about the presentation of the data model.
• You can also assign at least one label provider to a viewer so as to define
how the data from the model will be displayed in the viewer.
• Standard JFace viewer (ComboViewer, ListViewer, TreeViewer, TableViewer)
• These viewers are part of the org.eclipse.jface.viewers package
• Standard content provider (IStructuredContentProvider, ITreeContentProvider)
• Standard label provider (ILabelProvider, CellLabelProvider)
• JFace ComboViewer
• The ComboViewer class simplifies the implementation of a SWT Combo (Drop-down box).
https://www.vogella.com/tutorials/EclipseJFace/article.html#purpose-of-the-jface-viewer-framework
• JFace TableViewer:
• Content Provider: implements IStructuredContentProvider
• Label Provider: implements ITableLabelProvider
• JFace TreeViewer:
• Content Provider: implements ITreeContentProvider
• Label Provider: implements ITableLabelProvider
• JFace Tree Table Viewer and more… http://wikiict.org/eclipse/eclipse-jface-tutorial/
More examples
http://www.javased.com/index.php?api=org.eclipse.jface.viewers.TableViewer
Model & Content/Label Provider
• Please read the codes in the following java classes…and try to
understand how/what they work/do.
• AppMenu.java
• Article.java
• Employee.java
• Department.java
• DataModel.java
• How to differentiate which provider should be implemented for the
following java classes?
• AbstractComboContentLabelProvider.java
• AbstractTableContentLabelProvider.java
• AbstractTreeContentLabelProvider.java
• AbstractTreeTableContentLabelProvider.java
JFace TableViewer
• java classes:
• AppMenu.java
• Article.java
• Employee.java
• Department.java
• DataModel.java
• Provider:
• AbstractComboContentLabelProvider.java
• AbstractTableContentLabelProvider.java
• AbstractTreeContentLabelProvider.java
• AbstractTreeTableContentLabelProvider.java
• Create TableViewerDemo.java
File > New > Other... > WindowBuilder >
SWT Designer > SWT > Application Window
(注意import項目以及
修改List<Article>語法)
Source folder: JFaceTutorial/scr
Package: jfacetutorial.tableviewer
Name: TableViewerDemo
Create contents in:
select "protected createContents() method“ > Finish
• Create ArticleTableCLProvider.java extends
AbstractTableContentLabelProvider
(注意import項目以及png圖檔位置)
// Get TableViewer data.
List<Article> input = (List<Article>)tableViewer.getInput();
// Add row
Article newArticle = .... ;
input.add(newArticle);
// Refresh row
tableViewer.refresh(newArticle);
// Or
tableViewer.refresh();
// remove row
input.remove(<article>);
JFace Tree Viewer
• java classes:
• AppMenu.java
• Article.java
• Employee.java
• Department.java
• DataModel.java
• Provider:
• AbstractComboContentLabelProvider.java
• AbstractTableContentLabelProvider.java
• AbstractTreeContentLabelProvider.java
• AbstractTreeTableContentLabelProvider.java
• Create TreeViewerDemo.java
File > New > Other... > WindowBuilder >
SWT Designer > SWT > Application Window
(注意import項目)
Source folder: JFaceTutorial/scr
Package: jfacetutorial.treeviewer
Name: TreeViewerDemo
Create contents in:
select "protected createContents() method“ > Finish
• Create AppMenuTreeCLProvider.java extends
AbstractTreeTableContentLabelProvider
(注意import項目)
• In the case of a Tree with Column, you can set up
the title of columns, but sometimes it is unnecessary.
// Get data of TreeViewer.
List<AppMenu> input = (List<AppMenu>)treeViewer.getInput();
AppMenu menu = input.get(0);
List<AppMenu> childMenus = menu.getChildren();
// add AppMenu
childMenus .add(newAppMenu);
// Refresh
treeViewer.refresh(menu );
// or
treeViewer.refresh();
// Remove row similar.
JFace Tree Table Viewer
• java classes:
• AppMenu.java
• Article.java
• Employee.java
• Department.java
• DataModel.java
• Provider:
• AbstractComboContentLabelProvider.java
• AbstractTableContentLabelProvider.java
• AbstractTreeContentLabelProvider.java
• AbstractTreeTableContentLabelProvider.java
• Create TreeTableViewerDemo.java
File > New > Other... > WindowBuilder >
SWT Designer > SWT > Application Window
(注意import項目)
Source folder: JFaceTutorial/scr
Package: jfacetutorial.treetableviewer
Name: TreeTableViewerDemo
Create contents in:
select "protected createContents() method“ > Finish
• Create DeptEmpTreeTableCLProvider.java extends
AbstractTreeTableContentLabelProvider
(注意import項目)
// Get data of TreeTableViewer.
List<Department> input = (List<Department>)treeViewer.getInput();
Department dept = input.get(0);
List<Employee> empList = dept.getEmployees();
// Add employee for Department.
empList.add(newEmployee);
// Refresh
treeViewer.refresh(dept);
// or
treeViewer.refresh();
// Remove row similar.
Eclipse Ant basics
Creating
Ant buildfiles
• by default the Ant editor
only has an association with
build.xml named files.
• as long as the file has a .xml
extension, Eclipse will
consider it to be a possible
Ant buildfile
• create a *.xml first
• right click the *.xml
• Add an association between
*.xml and the Ant editor.
Editing Ant buildfiles
hit Ctrl-Space to activate content assist
Running Ant buildfiles
• Any file with a .xml extension can be run as an Ant buildfile.
• not all such files really are Ant buildfiles, but no harm is done if an attempt is
made to mistakenly run a non-Ant .xml file as an Ant buildfile.
Saving & Reusing Ant options
• Creating multiple launch configurations in this manner allows you to
quickly run your Ant buildfile in any configuration by simply specifying
the corresponding launch configuration.
• after Duplicate
• Rename the file
• The history is ordered so that the most frequently run configurations
are at the top of the drop-down.
Using the Ant view
• The main advantage of this view is that you can work with all of your
Ant buildfiles in one place, as opposed to hunting them down in one
of the navigation views.
Ant buildfiles as project builders
• You can change the order so that
your Ant buildfile runs before the
Java builder, though that wouldn't
make sense in this example.
• The Java builder runs the internal
Eclipse Java compiler which inturn is
responsible for indexing your source
so that searching, refactoring and
many other features are available.
• Thus it is not possible to replace the
internal Eclipse Java compiler by
using a project builder. You can
disable the Java builder and you can
control when the Java Builder runs
with respect to the project builders
that you define.
Executing project builders
• Try to create another Ant buildfile project
Track Resource Changes
to keep track of resource changes in the workspace
(as the files and folders that have been added,
modified, and removed from the workspace)
interface org.eclipse.core.resources.*;
public interface IResourceChangeEvent
• According to Eclipse API Specification, there are currently 5+1 different
types of resource change events
• PRE_BUILD
• POST_BUILD
• POST_CHANGE
• PRE_CLOSE
• PRE_DELETE
• PRE_REFRESH
https://help.eclipse.org/kepler/nftopic/org.eclipse.platform.doc.isv/referenc
e/api/org/eclipse/core/resources/IResourceChangeEvent.html
https://www.wideskills.com/eclipse-plugin-tutorial/eclipse-
plugin-track-resource-changes-tutorial
PRE_BUILD
• Before-the-fact batch reports of arbitrary creations, deletions and
modifications to one or more resources expressed as a hierarchical
resource delta. Event type is PRE_BUILD, and getDelta returns the
hierarchical delta rooted at the workspace root. The getBuildKind method
returns the kind of build that is about to occur, and the getSource method
returns the scope of the build (either the workspace or a single project).
These events are broadcast to interested parties immediately before each
build operation. If autobuilding is not enabled, these events still occur at
times when autobuild would have occurred. The workspace is open for
change during notification of these events. The delta reported in this event
cycle is identical across all listeners registered for this type of event.
Resource changes attempted during a PRE_BUILD callback must be done in
the thread doing the notification.
POST_BUILD
• After-the-fact batch reports of arbitrary creations, deletions and
modifications to one or more resources expressed as a hierarchical
resource delta. Event type is POST_BUILD, and getDelta returns the
hierarchical delta rooted at the workspace root. The getBuildKind method
returns the kind of build that occurred, and the getSource method returns
the scope of the build (either the workspace or a single project). These
events are broadcast to interested parties at the end of every build
operation. If autobuilding is not enabled, these events still occur at times
when autobuild would have occurred. The workspace is open for change
during notification of these events. The delta reported in this event cycle is
identical across all listeners registered for this type of event. Resource
changes attempted during a POST_BUILD callback must be done in the
thread doing the notification.
POST_CHANGE
• After-the-fact batch reports of arbitrary creations, deletions and
modifications to one or more resources expressed as a hierarchical
resource delta. Event type is POST_CHANGE, and getDelta returns the
hierarchical delta. The resource delta is rooted at the workspace root.
These events are broadcast to interested parties after a set of
resource changes and happen whether or not autobuilding is
enabled. The workspace is closed for change during notification of
these events. The delta reported in this event cycle is identical across
all listeners registered for this type of event.
PRE_CLOSE
• Before-the-fact reports of the impending closure of a single project.
Event type is PRE_CLOSE, and getResource returns the project being
closed. The workspace is closed for change during notification of
these events.
• Before-the-fact reports of the impending deletion of a single project.
Event type is PRE_DELETE, and getResource returns the project being
deleted. The workspace is closed for change during notification of
these events.
PRE_DELETE
• Before-the-fact reports of the impending refresh of a single project or
the workspace. Event type is PRE_REFRESH and the getSource
method returns the scope of the refresh (either the workspace or a
single project). If the event is fired by a project refresh the
getResource method returns the project being refreshed. The
workspace is closed for changes during notification of these events.
PRE_REFRESH
public interface IResourceChangeListener
extends EventListener
void resourceChanged (IResourceChangeEvent event)
• To modify PropertyManagerView so as to implement
IResourceChangeListener and use IResourceChangeEvent to update
itself.
public interface IResourceDelta
extends IAdaptable
• A resource delta represents changes in the state of a resource
tree between two discrete points in time.
• To modify PropertyManagerView so as to implement the
IAdaptable interface; extensions are managed by the platform's
adapter manager.
EGit
• Help > Install new Software
• …complete the installation
http://download.eclipse.org/egit/updates
https://wiki.eclipse.org/EGit/User_Guide
http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html
若無法安裝可取消勾選,否則重新安裝更新版的Eclipse
setting up EGit
• Window > Preferences
or change the Default
repository folder
Working with a local Git repository
• create a new Java project and a package
• add one sample class like following
• select the project > Team
> Share Project
• It is recommended to place your Git
repositories outside the Eclipse
workspace. After pressing
the Finish button in create dialog,
the wizard displays the settings for
your local Git repository.
• Select the Finish button again to put
your repository under Git version
control.
• You have created a local Git
repository. The Git repository is in this
case directly stored in the specified
folder in a .git folder.
• Window > Perspective > Open Perspective > Team Synchronizing
• Creating a file .gitignore in the project folder with the
following content:
• A gitignore file specifies intentionally
untracked files that Git should ignore.
• Files already tracked by Git are not affected.
• All files and directories which apply to the
pattern described in this file will be ignored
by Git. In this example all files in the bin and
the .metadata directory will be ignored.
• Using the Git Staging view drag only the all files you want to commit
into the Staged Changes area, write a meaningful commit message
and press the commit button.
• Right click the project > Window > Show View > Team > History
• Alt+Shift+W shortcut > History
• dirty (folder) - At least one file below the folder is dirty; that means that it has
changes in the working tree that are neither in the index nor in the repository.
• tracked - The resource is known to the Git repository and hence under version
control.
• untracked - The resource is not known to the Git repository and will not be version
controlled until it is explicitly added.
• ignored - The resource is ignored by the Git team provider. The preference settings
under Team -> Ignored Resources, "derived" flag and settings from .gitignore files are
taken into account.
• dirty - The resource has changes in the working tree that are neither in the index
nor in the repository.
• staged - The resource has changes which have been added to the index. Note that
adding changes to the index is currently possible only in the commit dialog via the
context menu of a resource.
• partially-staged - The resource has changes which are added to the index and
additional changes in the working tree that neither reached the index nor have been
committed to the repository. See partial staging from the Git Staging view for how to
do that.
• added - The resource has not yet reached any commit in the repository but has
been freshly added to the Git repository in order to be tracked in future.
• removed - The resource is staged for removal from the Git repository.
• conflict - A merge conflict exists for the file.
• assume-valid - The resource has the "assume unchanged" flag. This means that Git
stops checking the working tree files for possible modifications, so you need to
manually unset the bit to tell Git when you change the working tree file.
The button's icon changes
depending on the selected mode.
http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html#egit-Inspecting-State-Of-Repository
• to add an existing local Git repository to the view,
• to clone a Git repository
• to create a new Git repository
The button's icon changes
depending on the selected mode.
• The content area shows the existing
Git repositories and the structural
elements of this view.
• A right-click (context menu) on an
element in the Git repository view
allows you to perform related Git
operations.
Cloning Remote Repositories
• File > Import
• then, go to https://git.eclipse.org/
• enter the location
of the remote
repository.
• note: URI, Host and
Repository path
may be different
• choose which branches shall be
cloned from the remote repository.
• define where you want to store the
repository on the local file system
and define some initial settings.
• note: The default is "origin"
Performing Git operations
• Once you have placed a
project under version control
you can start using team
operations on your project.
• The team operations are
available via right-click on
your project or file.
The most important operations are described in the following list. Select:
• Team -> Add to index, to add the selected resource(s) to the index of Git
• Team -> Commit, to open the commit dialog for committing to your Git repository
• Team -> Create Patch..., to create a patch
• Team -> Apply Patch..., to apply a patch to your file system
• Team -> Ignore, to add the file to a .gitignore file
• Team -> Show in History, to display the selected files and folders in the History view
• Team -> Pull to pull in changes from your remote Git repository
• Team -> Fetch to fetch the current state from the remote repository
• Team -> Switch To to switch or create new branches.
• Team -> Push to push changes to your remote Git repository
• Team -> Tag to create and manage tags.
http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html#egit-PerformingGitOperations
• If you recognize that you
missed something when
committing a change
you may fix this: open
the staging view or
commit dialog again and
specify that the current
commit shall "amend"
the previous commit in
the current branch.
• note: do NOT amend
commits if they have
already been published
to a shared repository
since this may disturb
others if they already
based their changes on
the published change.
drag
Branching
• You may switch back to ‘master’
• select the branch to rename
• enter the new branch name > OK
• two alternative ways to Rename Branch…
• Deleting a Branch takes
the same three ways to
complete as mentioned
above when renaming a
branch.
• The currently checked out
branch can not be deleted
• If deletion of the branch
may result in data loss, a
warning is displayed that
must be confirmed
Merging • A merge include changes from another
branch or tag, since the time their
histories diverged from the current branch,
into the currently checked out branch.
• A merge can result in conflicts which require user action.
• select the top level resource showing the red conflict label decorator.
• click Team -> Merge Tool
• select the merge mode Use HEAD (the last local version) of conflicting files and click OK
• more details about how conflicts are presented:
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-
merge.html#_how_conflicts_are_presented
• Ways to resolve the conflicts:
• Using Merge Tool
• Manually editing the conflicting resource by telling EGit (Team > Add) to resolve the
conflict (Team > Commit)
• Finding conflicting files to resolve the conflicts.
• Committing or Aborting a merge
Rebasing
• The Git Repositories view
allows you to rebase your
currently checkout branch
onto another branch.
• If the rebase was successful a
dialog is shown.
• You have to resolve rebase
conflicts if they occur.
• if you want to cancel the
rebase operation select Rebase
-> Skip and Rebase -> Abort.
• You may also reset to specific
branch or tag: Select Team ->
Reset... on a project (or
(Repositories view or History view)
• You may also revert all local and
staged changes: reset to the
current HEAD by using a hard
reset. (right click on a project or
Repositories view or History view)
• soft - the HEAD points now to the new commit,
the index and the working tree are unchanged.
• mixed - the HEAD points now to the new
commit, the index is updated, the working tree
is unchanged.
• hard - the HEAD points now to the new commit,
the index and the working tree are updated
More details about EGit, please open Eclipse
> Help > EGit Documentation > EGit User Guide
Builders, Markers and Natures
https://www.wideskills.com/eclipse-plugin-tutorial/eclipse-builders-natures-and-markers
• builders are used to take java source as input and generate
corresponding class files
• Incremental Builders - These contribute to performance improvement by
rebuilding only the delta since last full build.
• markers are used to mark error locations, warnings, book marks etc. in
(Java) editor.
• natures are used to link project with various functionalities such as
builders in a project.
• For ex: if we add java nature to a project inside eclipse. It associates project with
incremental java compiler. natures are added in .project file of the project.
Creating Builders Nature using existing templates
• an builder's (incremental) name: sample
builder
• this builder validates XML file and if
required adds a problem marker to
problematic xml files
• this builder will run only for projects
which have declared themselves as having
sample nature projects
• Creating a plug-in project first !
File > New > Project… > Plug-in
Development > Plug-in Project >
MANIFEST.MF
• Create a xml file.
Eclipse Builders
• New builder is created by extending the
org.eclipse.core.resources.builders extension point.
• ID and name are used to give builder a data value and
name respectively.
• the builder element.
• the hasNature attribute
flags whether this builder
is associated with any
nature.
• the run element.
• the class attribute
• here we specify the actual
java class which provides
the functionality of the
builder.
IncrementalProjectBuilder
• the java class (testplugin.builder.SampleBuilder) needs more attention as
this is the class which is doing the actual work.
• Any builder class must be a subclass of IncrementalProjectBuilder.
• All builders must subclass this class according to the following guidelines:
• Subclasses should implement the build method of this class
• Subclasses may implement remaining methods
• Subclasses should supply a public and NO arg constructor
• More details about class IncrementalProjectBuilder
https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv
/reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html
• The build method requires special attention as well.
• This method of the builder is called whenever build is required
build (int kind, Map args, IProgressMonitor monitor)
we are using kind parameter to understand the kind of build request.
• kind: what kind of build is required?
• kind parameter could be a FULL_BUILD, INCREMENTAL_BUILD, and AUTO_BUILD.
• args: a Map to pass arguments/information to builder.
• monitor: a progress monitor
• Eclipse will call build method of the builder whenever any type of build is
required.
• Here has implemented two methods for each kind of build
• full build
• incremental build
• we are delegating calls to Visitors.
• visitor will visit all the resources (in
case of delta only the modified
resources since last build).
• For each resource we are calling
checkXML() method.
• CheckXML method essentially
delegates call to XMLErrorHandler
defined in builder class which will
check if XML document is well
formed or not.
• In case it is not well formed it will
create a marker (as shown below).
Markers
• There are many types of predefined markers defined as constants in
IMarker interface.
• org.eclipse.core.resources.bookmarkIMarker.BOOKMARK
org.eclipse.core.resources.markerIMarker.MARKER
org.eclipse.core.resources.problemmarker IMarker.PROBLEM
org.eclipse.core.resources.taskmarkerIMarker.TASK
org.eclipse.core.resources.textmarkerIMarker.TEXT
IMarker
• New marker is created by extending
org.eclipse.core.resources.markers extension point.
• ID and Name are datavalue and name respectively.
• Next, we need to define the super type marker for
new marker.
• Since we want to show errors in Problems View we are using
org.eclipse.core.resources.problemmarker as supertype.
IMarker is the main interface when we are dealing with eclipse markers.
• Next is the
persistent element.
• Since we want this
markers to persist
across eclipse
sessions we are
setting this property
to true.
• addMarker method in SampleBuilder class is used to show above
defined marker in the editor whenever problem/error occurs.
• more details about IMarker interface
https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2F
reference%2Fapi%2Forg%2Feclipse%2Fcore%2Fresources%2FIMarker.html
Natures
• Natures are not only used to associate builders but are also used to
define many other functionalities
• for ex: only java nature projects are shown in Package Explorer.
• Some of the predefined natures are
org.eclipse.jdt.core.javanature,org.eclipse.pde.PluginNature.
• Nature is created by extending org.eclipse.core.resources.natures
extension point.
• ID is the unique identifier for this nature.
• Name is the human readable name of the nature.
• Next element is the builder. Here we will add a builder to this nature.
• We have associated SampleBuilder created earlier with this nature. So that
projects with SampleNature use SampleBuilder whenever an XML file is saved.
• Next elements are runtime and run. Here
we will specify a class named
SampleNature which will be used to
configure/deconfigure project with
Sample Nature.
• With the help of this class we will be able to
configure non Sample Nature project to
Sample Nature project at run time.
• OR we will be able to convert Sample Nature
Project to non Sample Nature project.
• Repercussions of making a Project as
Sample Nature project will be that a
Sample builder will be attached to project
which will run whenever an XML file is
saved and will look for any errors in XML.
IProjectNature
• It can configure a project with the project nature, or de-configure it.
• Please refer to Eclipse API Specification to know more about this class.
• Here, user is provided with toggle action to convert non Sample Nature
project to Sample Nature project. Following method from
SampleNature class will be called to associate the project with
SampleNature.
• Every workbench project contains a .project file that contains build
commands. Executing above method causes the following to appear in
the buildSpec section of the project's .project file. Also Sample nature is
added in natures section.
https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/
reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html
Eclipse Help
https://www.eclipse.org/articles/article.php?file=Article-AddingHelpToRCP/index.html
https://www.eclipse.org/forums/index.php/t/204877/
The Eclipse help system
• uses a browser-based presentation and therefore has full support for HTML.
• search is automatically included in the help system
• context help and keyword index are supported if you provide the appropriate
content files.
1. Create a Rich Client Application
• File > New > Project... > Plug-in Project
2. Create a Product Configuration
3. Add Source Code
4. Test
5. Add Required Plug-ins
6. Test Again
7. Add Sample Help Content
8. Add Context Help Support
9. Test context help
10. Setting Help Preferences
2. Create a Product Configuration
• Switch to the Plug-in Development perspective
• Select "File > New > Product Configuration" from the main menu.
• Select "org.eclipse.helprcp" in the resulting "New Product Configuration" wizard page.
• Input "helprcp.product" into the "File name" text box.
• Select the "Use an existing product" radio button inside the "Initialize the file content"
group and click "Finish". The "Product Configuration Editor" will open.
2. Create a Product Configuration (continued)
• Input "Help RCP Application" into the "Product Name" text box.
• Verify "org.eclipse.helprcp.product" is the default value in the "Product ID" drop down menu.
• Select "File > Save" from the main menu.
• From the "Overview" tab of the "Product Configuration Editor" click on "Launch an Eclipse
Application" and verify that the application launches.
3. Add Source Code
• make a few source changes to add the help actions
to the menu.
• add the lines marked "// NEW" to the class
• add the lines marked "// NEW" to function
"ApplicationActionBarAdvisor.makeActions()"
• add the lines marked "// NEW" to function
"ApplicationActionBarAdvisor.fillMenuBar()"
https://www.eclipse.org/articles/article.php
?file=Article-AddingHelpToRCP/index.html
4. Test
Launch the application from the
"Product Configuration Editor"
> Help > now has additional entries
but neither of them does anything.
This is because we still need to
import the plug-ins that comprise
the Eclipse help system.
5. Add Required Plug-ins
1) Click the “product configuration" link in the Overview tab
2) Add "org.eclipse.help.webapp" and "org.eclipse.help.ui" to the list in the "Plug-ins and Fragments"
section.
3) Click the "Add Required Plug-ins" button.
4) Select the checkbox to "Include optional dependencies when computing required plug-ins".
• If you omit this step the help system will not have all the plug-ins it needs and you will see an exception at startup.
5) Select "File > Save" from the main menu.
• https://www.wideskills.com/eclipse-plugin-tutorial/eclipse-plugin-
help-tutorial
• https://www.codeproject.com/Articles/1257687/Documenting-Your-
Project-Using-the-Eclipse-Help-Sy
• https://www.vogella.com/tutorials/EclipseRCPHelpSystem/article.htm
l
• https://www.ibm.com/support/pages/creating-help-plug-ins-and-
adding-rational-help-content
Custom Text Editor
Eclipse provides rich support for creating editors that operate on text,
such as programming language editors or document editors.
• change font style for a text file
• change text color by modifying the Appearance color
options for Foreground and Background color
https://stackoverflow.com/questions/59251808/changing-font-and-colour-of-text-in-eclipse-text-editor
various plug-ins that provide facilities for
text processing
• org.eclipse.text: provides a model for manipulating text and has no visual components, so it can
be used by headless programs that process or manipulate text.
• org.eclipse.swt: the class StyledText is the SWT user-interface object for displaying and editing
text. Everything the user sees is rooted here: colors, fonts, selections, the caret (I-beam cursor),
and more. You can add all kinds of listeners to this widget to follow what the user is doing. It also
supports some fancier features, such as word wrapping and printing.
• org.eclipse.jface.text: This is the marriage of the model provided by org.eclipse.text and the view
provided by StyledText. It is the heart of the text framework.
• org.eclipse.ui.workbench.texteditor: You can't use the features provided here without being part
of a running Eclipse workbench. It supports text editors that appear in the workbench editor area
and features a large collection of Action subclasses for manipulating the contents of an editor, as
well as support for annotations, incremental search, and more.
• org.eclipse.ui.editors: It provides the main concrete editor in the base Eclipse Platform, the
default text editor.
• and more text infrastructures…
https://wiki.eclipse.org/FAQ_What_support_is_there_for_creating_custom_text_editors%3F
All editors start by making a subclass of EditorPart
from the org.eclipse.ui.part package.
• create a plug-in project
• add one or more new extensions by using Extension Wizards
• MANIFEST > Extension > Add > Extension Wizard > Editor or Extensible Editor…
• E.g., a simple XML Editor will be created > go to “src” folder > search XMLEditor and
XMLConfiguration java classes > modify the constructor of the XMLEditor class >
modify XMLConfiguration class
• note: debug a little bit by yourself; since it is an XML Editor, only quoted strings
should be spell checked and the XML tags should be skipped.
http://blog.ankursharma.org/2009/08/adding-spellchecking-to-custom-editors_19.html
• If you are using a product, add your new plug-ins
(org.eclipse.core.contenttype.contentTypes and org.eclipse.ui.editors) to
your feature and start a runtime Eclipse via the product.
• set the preferenceStore for checking dictionary and other preferences from
Window > Preferences > General > Editors > Text Editors > Spelling .
https://www.vogella.com/tutorials/EclipseEditors/article.html
Useful and Interesting resources
• http://help.eclipse.org/2019-
09/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/editors_highlighting.htm
• https://marketplace.eclipse.org/category/free-tagging/editor
• https://marketplace.eclipse.org/category/free-tagging/structured-text
• https://www.eclipse.org/efxclipse/index.html
• https://www.jotform.com/widgets/category/text-editor
Rich Text Editor
• Help -> Install New Software...
• Add a new site using the url http://static-
tmsoftstudio.appspot.com/richtexteditor to the Eclipse Update Manager.
• Select the bundles from the list that you would like to install and click Next.
https://marketplace.eclipse.org/content/rich-text-editor/help
https://projects.eclipse.org/projects/technology.dltk/releases/6.0
Note: Eclipse Dynamic Languages Toolkit 5.11 is a part of Eclipse IDE 2019-09
Graphical Editing Framework
(GEF) 圖形化編輯框架
(org.eclipse.gef) - an
interactive MVC
framework built on
top of Draw2d
The Common component provides key concepts and infrastructure to be potentially used by all other GEF
components
https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.gef.layout.doc%2Freference%2Fwiki%2FLayout.html
http://www.aspphp.online/bianchen/java/gyjava/201701/128934.html
http://www.aspphp.online/bianchen/java/gyjava/201701/ 128924 ~ 128935.html
• an open source framework dedicated to
providing a rich, consistent graphical editing
environment for applications on the Eclipse
Platform
• https://wiki.eclipse.org/GEF/Developer_FAQ
• GEF (MVC) is interactive model-view-
controler fraDraw2d-based graphical
editors mework, which fosters the
implementation of SWT-based tree and for
the Eclipse Workbench UI.
• https://www.eclipse.org/gef/gef_mvc/
• https://www.eclipse.org/gef/
• Download GEF update 5.3.0 (latest *.zip)
• https://www.eclipse.org/gef/download.php?fil
e=/tools/gef/downloads/drops//5.3.0/I201912
070301/GEF-Update-5.3.0.zip
• https://www.eclipse.org/gef/downloads/index
.php?showAll=1&hlbuild=S201905091638
• https://projects.eclipse.org/projects/tools.gef
• After complete the install, follow the steps on this page
• https://github.com/eclipse/gef#eclipse-graphical-editing-framework-gef
• Set up an Eclipse IDE
• Set up a Target Definition containing GEF
• Run the examples
• Other resources
• https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.gef.doc.isv%2F
guide%2Fguide.html
• https://www.eclipse.org/articles/Article-GEF-diagram-editor/shape.html

More Related Content

What's hot

Migrating Unity3D projects to Windows 8
Migrating Unity3D projects to Windows 8Migrating Unity3D projects to Windows 8
Migrating Unity3D projects to Windows 8282productions
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorialprad_123
 
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
Rewriting a Plugin Architecture 3 Times to Harness the API EconomyRewriting a Plugin Architecture 3 Times to Harness the API Economy
Rewriting a Plugin Architecture 3 Times to Harness the API EconomyTim Pettersen
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to MavenJoao Pereira
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.xSam Brannen
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven Ankit Gubrani
 
Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driverPankaj Biswas
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeHolasz Kati
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 featuresAngel Ruiz
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 

What's hot (19)

Maven basics
Maven basicsMaven basics
Maven basics
 
Migrating Unity3D projects to Windows 8
Migrating Unity3D projects to Windows 8Migrating Unity3D projects to Windows 8
Migrating Unity3D projects to Windows 8
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorial
 
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
Rewriting a Plugin Architecture 3 Times to Harness the API EconomyRewriting a Plugin Architecture 3 Times to Harness the API Economy
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.x
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
 
Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driver
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
Installing the java sdk
Installing the java sdkInstalling the java sdk
Installing the java sdk
 
Selenium Handbook
Selenium HandbookSelenium Handbook
Selenium Handbook
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 

Similar to Eclipse IDE, 2019.09, Java Development

IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...Paul Withers
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the BasicsUlrich Krause
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC DeploymentsSujit Kumar
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer ToolsWO Community
 
Introduction to Bitreactive
Introduction to BitreactiveIntroduction to Bitreactive
Introduction to BitreactiveGhassen Chaieb
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN ControllerSumit Arora
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014scolestock
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...Paul Withers
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPagesUlrich Krause
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicKalkey
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Thecreating Experts
 
Kinect installation guide
Kinect installation guideKinect installation guide
Kinect installation guidegilmsdn
 
Using the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with SubversionUsing the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with SubversionDebbie Wilson
 

Similar to Eclipse IDE, 2019.09, Java Development (20)

IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Introduction to Bitreactive
Introduction to BitreactiveIntroduction to Bitreactive
Introduction to Bitreactive
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014DevOps with Elastic Beanstalk - TCCC-2014
DevOps with Elastic Beanstalk - TCCC-2014
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
 
Osgi
OsgiOsgi
Osgi
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPages
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2
 
Kinect installation guide
Kinect installation guideKinect installation guide
Kinect installation guide
 
Using the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with SubversionUsing the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with Subversion
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Eclipse IDE, 2019.09, Java Development

  • 5. • Restart Eclipse • Window > Perspective > Open Perspective > Other • enter URL (SVN server and acc-pwd) • 1. CollabNet Desktop (free) • 2. CloudForge 3. Github (free) http://subclipse.tigris.org/wiki/RepositoryProviders https://app.cloudforge.com/subscriptions/new/?product=Freesource=subclipse https://progressbar.tw/posts/3 https://github.com/join/plan
  • 6. https://xken831.pixnet.net/blog/post/434388596- %5Bjava%5D%5Bide%5D%5Beclipse%5Declipse- svn%E5%AE%89%E8%A3%9D After install CollabNet, restart the Eclipse The zip file has sent to your registered email address from CollabNet.
  • 7. • After connection, click Java button to go back to your local site.
  • 8. • go back to your local Java site • select a Project you want to share • Right click on the Project > Team > Share Project… • Similar procedures as ‘import a new Project into a SVN Project…’ http://help.collab.net/index.jsp?topic=/org.tigris.subclip se.doc/topics/new-location.html
  • 9. • must specify the folder name where you want to store the project • The folder name is relative to the URL of the repository location you specified in the previous step. • All intermediate folders must already exist in the repository, but the final folder name must NOT already exist. (e.g., ProjectName must exist; trunk must NOT) • You can use the Browse... button to help you create (intermediate) folders. • the convention of storing the project in a ProjectName/trunk structure.
  • 10. • SVN’s default folders: trunk, branches • Files must be placed under trunk before uploading them • Trunk is like a root If any error occurred, see the next slide
  • 11. Files must be placed under trunk before commit them to a remote platform, such at Github http://chrislin1015- blog.logdown.com/posts/1 082135-svn-and-encounter- mkcol-not-allowed-github- upload-error-messages
  • 12.
  • 13.
  • 14. • making a copy of a project from a repository into your local workspace • In SVN, the check out process creates a working copy. • A working copy is a specially formatted folder structure which contains additional .svn folders that store SVN information, as well as a pristine copy of each item that is checked out. • Process • navigate to the SVN Repository Exploring Perspective
  • 15. • If an Eclipse .project file already exists in the selected repository folder, the check out wizard will automatically default the method of checkout and using the project definition file. • If no .project file exists in the selected repository location, the wizard will give you the option of checking out the folder as a regular Eclipse project or launching the New Project Wizard. • To select an alternative location, uncheck the use default workspace location option and type or Browse for a new target location.
  • 17. What is CBI • Maven with the Tycho plugins • Tycho plugins teach Maven how to build Eclipse plugins and OSGi bundles. • This enables building Eclipse projects with “maven clean install” just as one would build other Maven projects. • Common services • Jar signing facility • MacOS signing facility • Windows signing facility • mature templates and common pom.xml files will be provided • part of CBI • Git, Hudson, the build slaves • Nexus (aka. the artifact repository & server side of Maven) • Gerrit, Bugzilla, and the Downloads site
  • 18. • Before using tycho, create a short sample project consisting of a small eclipse-like product along with an additional feature. • Download sample project from here https://github.com/Pontesegger/code andme/blob/master/Code%20&%20 Me%20Blog/tycho_01_build_plugins. zip?raw=true
  • 21. • The wizard asks for a Group Id. • All projects that belong together will get the same Group Id. • Use a name that represents the component you want to build. • Artifact Id should match the Bundle-SymbolicName found in MANIFEST.MF. • Version should be set accordingly to Bundle-Version from the manifest. • SNAPSHOT in maven is similar to qualifier in you plug-in version. • Packaging tells maven what type of build instructions to use. • Set it to eclipse-plugin.
  • 22. • Maven creates a pom.xml for you ! • Current version of Tycho version is 1.4.0 • Replace the codes • Build our bundle https://www.eclipse.org/tycho/
  • 23. • Replace the codes • property for the tycho version to be used. • For future tycho versions you will need to upgrade this. • the Mars p2 repository for resolving dependencies during build time. • build section tells maven to use the tycho plug-in for the build process. • You will see some errors/problems. • Build our bundle • Right click on the project → select Run As → Maven build... • Under Goals enter clean install. • Goals are related to the maven lifecycle. we tell maven to delete previous build artifacts, to build our plug-in and to install build results. http://codeandme.blogspot.com/2012/12/tycho-build-1-building-plug-ins.html
  • 24.
  • 25.
  • 26.
  • 28. • Extension (contribution): contribute functionality to a certain type of API • Contribution can be code or data • Extension point: to define the type of API by a plug-in • Plug-in: contains the necessary code to … • defines extension point • declare the extension point in its plugin.xml file • be responsible for evaluating the extensions • allow other plug-ins to add contributions (extensions) to the extension point. • provides an extension (contribution) based on the contract defined by an existing extension point
  • 29. Prerequisites • you should have basic understanding of development for the Eclipse platform. Eclipse RCP Tutorial or Eclipse Plug-in Tutorial. Please complete the following steps: • 3. Install the e4 tools • 4. Install the e4 spies • 5. Create an RCP application with the wizard
  • 30. Creating an extension point • an XML schema file • contains code to evaluate the extensions
  • 31. Adding extensions to extension points modifying the MANIFEST.MF file
  • 32. Accessing extensions • After adding one extension you can right-click on it to add elements or attributes. • The information about the available extension points and the provided extensions are stored in a class of type IExtensionRegistry. • The Eclipse platform reads the extension points and provided extensions once the plug-in is in the RESOLVED life cycle status as defined by the OSGi specification. • You can use the dependency injection mechanism to get the IExtensionRegistry class injected.
  • 33. Extension factories • If you create your class directly via the IConfigurationElement class of the extension you are limited to classes which have a default constructor. To avoid this restriction you can use extension factories. • To use a factory implement the interface IExecutableExtensionFactory in the class attribute of your extension point definition. The factory receives the configuration elements and can construct the required object.
  • 34. Exercise: create two new plug-ins Create and evaluate an extension point 1. Creating a plug-in for the extension point definition
  • 35. 2. Create an extension point Open the MANIFEST.MF file or the plugin.xml file and select the Extension Points tab.
  • 36. • The definition of the extension is generated and the schema editor opens. • Switch to the Definition tab.
  • 37. 3. Add New Element and New Attributes to the extension point. Implement = Interface name This interface doesn’t exit yet. Press on the hyperlink called Implements to create it based on the following code.
  • 38.
  • 39. • Go back to your extension point definition and add a choice to the extension point. • This defines how often the extension “zkl" can be provided by contributing plug-ins. We will set no restrictions (unbound).
  • 40.
  • 41. 4. Export the package Select the MANIFEST.MF file switch to the Runtime tab and export the package which contains the com.phh.expointphh.Interface.
  • 42. 5. Add dependencies • Add the following dependencies via the MANIFEST.MF file of your new plug-in: org.eclipse.core.runtime org.eclipse.e4.core.di 6. Evaluating the registered extensions - create a handler class which can evaluate the existing extensions.
  • 43.
  • 44. • The code uses the ISafeRunnable interface. This interface protects the plug-in which defines the extension point from malfunction extensions. • If an extension throws an Exception, it will be caught by ISafeRunnable and the remaining extensions will still get executed. • Review the .exsd schema file and the reference to this file in the plugin.xml file
  • 45. 7. Create a menu entry and add it to your product in the MANIFEST.MF file of your application plug-in. Add a dependency to the com.phh.extpointphh plug-in Afterwards create a new menu entry called Evaluate extensions and define a command and handler for this menu entry. In the handler point to the EvaluateContributionsHandler class.
  • 46. 8. Providing an extension • Create a new simple plug-in • Open the MANIFEST.MF editor of this new plug-in and select the Dependencies tab. • Add the org.eclipse.core.runtime and the plug-ins you created as dependencies. • Make sure your plug-in has the This plug-in is a singleton flag set on the Overview tab for your MANIFEST.MF file.
  • 47. • Switch to the Extensions tab • Select your custom extension point to Finish • Add zkl to your extension point via right-click.
  • 48. • create a class • E.g., PhhTW
  • 49. 9. Add the new plug-ins to your product com.phh.extpointphh com.phh.extpointphh2 10. Validate • Start your application via the product configuration file. This updates the plug- ins included in the run configuration. • In your running application select your new menu entry. The handler class write the output of your extensions to the Console view of your Eclipse IDE.
  • 50. SWT Standward Widget Toolkit (可移植構件工具包) https://www.eclipse.org/swt/ an open source widget toolkit for Java
  • 51. SWT Snippets • minimal stand-alone programs • demonstrate specific techniques or functionality • if you are programming with JFace, you may find JFace Snippets useful • To run a snippet • import SWT .zip file into your workspace • File > import …> Existing Projects Into Workspace • create a project called org.eclipse.swt in your workspace. • Your Java projects can then add the SWT project as a dependency. • Open the properties dialog of your Java project • on the Java Build Path page, include the org.eclipse.swt project. https://download.eclipse.org/eclipse/downloads/ https://download.eclipse.org/eclipse/downloads/drops4/R-4.13-201909161045/ https://www.eclipse.org/swt/snippets/
  • 52. • copy the desired snippet (e.g., JFaceSnippets) to the clipboard, and paste it into a new snippet class (under src folder). JFaceSnippets https://wiki.eclipse.org/JFaceSnip pets#Snippet012_- _Dialog_with_Image_Buttons
  • 53. SWT Examples • much larger and more comprehensive than SWT Snippets. 1. Install the examples • Running the SWT Examples inside Eclipse • Installing the examples • Ensure Group items by category is unchecked. • Type "Eclipse SDK Examples" in the search field. • Next > Next > accept the license terms > Finish • Restart Eclipse to take effect. https://www.eclipse.org/swt/examples.php
  • 54. • You may also installing examples manually • Download the appropriate Eclipse SDK Example zip file from the Eclipse project web site at http://download.eclipse.org/eclip se. • Extract the contents of the zip file to a new empty directory inside the dropins directory of your Eclipse installation. • Start or restart Eclipse. • You can verify that examples have been installed by looking for File > New > Example... in the workbench menu bar.
  • 55. 2. Running the SWT examples with the SWT Example Launcher
  • 56. 3. Running the SWT standalone examples Browse ... button to locate the following directory (according to the Eclipse version and the original installation location): eclipse/plugins/org.eclipse.sdk.examples.source _3.1.0/src/org.eclipse.swt.examples_3.1.0 C:Userspclabeclipsejava-2019- 09eclipsepluginsorg.eclipse.sdk.examples.source-4.13plugins
  • 57. Next > Project > Add > org.eclipse.swt > OK > Finish • At this point your SWT examples should be compiled without any errors. • Check the Problems view for errors. • If you get an error like "java.lang.Object not found" it means you have not configured a JRE. • Go to the Window > Preferences ... dialog and select the Java > Installed JREs preference page. • Ensure that a JRE is installed and that the path to the JRE is correct.
  • 58. • run the SWT standalone examples • Open the Java perspective. • In the Packages view, select the main class that you want to run. • Select Run > Run As... > Java Application from the main menu.
  • 59. Using OpenGL in SWT Applications https://www.eclipse.org/swt/opengl/
  • 61.
  • 63.
  • 64. JFace you need to create a SWT Project before starting with JFace Step 1. http://wikiict.org/java/java-swt-programming-tutorials/java-desktop-application-programming-using-swt/ note: follow the instruction of “7- Using WindowBuilder” Step 2. download the SWT Binary and Source (see next slide, you should have installed) Step 3. create a new plug-in project (you should know how to do it) note: RCP Plugin Project has to be created no matter what. http://wikiict.org/eclipse/eclipse-jface-tutorial/
  • 65. copied from the previous lecture
  • 66.
  • 67.
  • 68. JFace resource manager for Colors, Fonts and Images • SWT is based on the native widgets of the OS. • Whenever an SWT widget is allocated, a corresponding OS specific widget is created. • The Java garbage collector cannot automatically clean-up these OS-specific widget references. • Fortunately all widgets which are created based on a parent widget are automatically disposed when the parent Composite is disposed. • If you develop Eclipse plug-ins, the Composite of a part is automatically disposed once the part is closed. • Therefore, these SWT widgets are handled automatically in Eclipse plug-in projects. • However, this rule does NOT apply for colors, fonts and images, as these may be reused in other places. • For this reason, they need to be explicitly disposed. • JFace provides the ResourceManager and its derived classes for managing such resources automatically. • An instance of the LocalResourceManager class is created with a reference to a Control. If this Control is disposed, the resources created by the LocalResourceManager are also disposed. https://www.vogella.com/tutorials/EclipseJFace/article.html#jface_localresoucemanager You should use always use a JFace ResouceManager if possible. This avoids problems with system resources or even a "No more handles" SWTException.
  • 69. • create a Package • copy and paste an image • create another Package to test how SWT manage data sources (color, font, image) and how JFace manages
  • 71. • A class SWTResourceManager is automatically created. • It is a class with utility methods for managing image, Font, Color. You may change the title “SWT Application” e.g., “Rsdemo Application” Go to Properties > text in the Design tab
  • 72.
  • 73. • You may also change the foreground and font style. Then, see the code is generated from Source tab for the class which was the one automatically generated when you create a Package to test JFace RS (resource) manager
  • 74. • Please read those codes…and try to understand how/what they work/do
  • 75. Using Decoration control • The ControlDecoration class allows you to place image decorations on SWT controls to show additional information about the control. • These decorations can also have a description text which is displayed once the user places the mouse over them. • During the layout of your screen you need to make sure that enough space is available to display these decorations. • For example, to highlight a Text field requires input 1. create a Package as the way how you create SWT Application (File > New > Other… > WindowBuilder > SWT Designer > SWT > Application Window) 2. go to Design tab 3. add a Text field add ControlDecoration from JFace (see next two slides) 4. go to Source tab add the codes http://wikiict.org/eclipse/eclipse-jface-tutorial/ to copy the codes https://www.vogella.com/tutorials/EclipseJFace/article.html#controldecoration
  • 76.
  • 77. Q1. How to re-allocate the Text field ? Q2. How to input from Right ? Answers are in the next slide !!!
  • 78. A: SWT Widgets Q1. Layouts > Grid > Q2. Properties > Style > Note: Widgets can contain other widgets (container) http://wikiict.org/java/java-swt-programming-tutorials/java- desktop-application-programming-using-swt/ You can view the demo of the Control at the link below, it’s RWT (RAP Widget Toolkit) Control, but they are essentially the same as SWT control. http://rap.eclipsesource.com/de mo/release/controls/
  • 79. JFaceSnippets • Select one snippet • The header section of each snippet is a link to the plain source. • Copy the source and then Paste it directly on the src folder or package in an eclipse project. • The package and the class will be created automatically. • Run the snippet as Java Application https://wiki.eclipse.org/JFaceSnippets
  • 80.
  • 82. SWT Widget http://wikiict.org/java/java-swt-programming-tutorials/java-desktop-application-programming-using-swt/ SWT widgets are located in the packages org.eclipse.swt.widgets and org.eclipse.swt.custom.
  • 83. Preparation • Maker sure WindowBuilder has been installed • Create RCP Plugin Project: File > New > Other… • Add swt library: MANIFEST.MF > Dependencies > Add org.eclipse.swt org.eclipse.swt.win32.win32x86_64 • SWT snippets https://www.eclipse.org/swt/snippets/#browser copy and paste the desired snippet into a new snippet class (under src folder).
  • 84. Method 1: • Window > Perspective > Open Perspective > Java • File > Import... > Plug-in Development > Plug-ins and Fragments > Next Method 2: • Open page http://download.eclipse.org/eclipse/downloads/#La test_Release in your web browser • go to the latest release build • find the SWT Binary and Source • Download zip file for your platform (e.g., swt-4.4.2-win32-win32-x86_64.zip) • do NOT extract the zip file • File > Import … • select Existing Projects into Workspace • click Next • specify the archive file you downloaded • click Finish
  • 85. SWT (standard) layout classes • in the SWT library are: • FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row or column. It does NOT wrap, and you canNOT specify margins or spacing. https://youtu.be/RmGN7DPCRZc • RowLayout – more commonly used for its ability to wrap, and for its configurable margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing options. The height and width of each widget in this layout can be specified by setting a RowData object into the widget using setLayoutData. https://youtu.be/NzNiQijx96g • GridLayout – the most useful and powerful of the standard layouts, but it is also the most complicated. It lays out widget children of a Composite in a grid. It has a number of configuration fields (just like RowLayout), the widgets it lays out can have an associated layout data object, called GridData. https://youtu.be/vun90MHAGJc
  • 86.
  • 87.
  • 88.
  • 89.
  • 90. SWT (standard) layout classes • in the SWT library are: • FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row or column. It does NOT wrap, and you canNOT specify margins or spacing. https://youtu.be/RmGN7DPCRZc • RowLayout – more commonly used for its ability to wrap, and for its configurable margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing options. The height and width of each widget in this layout can be specified by setting a RowData object into the widget using setLayoutData. https://youtu.be/NzNiQijx96g • GridLayout – the most useful and powerful of the standard layouts, but it is also the most complicated. It lays out widget children of a Composite in a grid. It has a number of configuration fields (just like RowLayout), the widgets it lays out can have an associated layout data object, called GridData. https://youtu.be/vun90MHAGJc
  • 91.
  • 93. SWT (standard) layout classes • in the SWT library are: • FillLayout – the simplest layout class. It lays out equal-sized widgets in a single row or column. It does NOT wrap, and you canNOT specify margins or spacing. https://youtu.be/RmGN7DPCRZc • RowLayout – more commonly used for its ability to wrap, and for its configurable margins and spacing. It lays out widgets in a row or rows, with fill, wrap, and spacing options. The height and width of each widget in this layout can be specified by setting a RowData object into the widget using setLayoutData. https://youtu.be/NzNiQijx96g • GridLayout – the most useful and powerful of the standard layouts, but it is also the most complicated. It lays out widget children of a Composite in a grid. It has a number of configuration fields (just like RowLayout), the widgets it lays out can have an associated layout data object, called GridData. https://youtu.be/vun90MHAGJc
  • 94.
  • 95.
  • 96. drag to merge cells
  • 97. SWT StackLayout • stacks all the controls one on top of the other and resizes all controls to have the same size and location. • topControl is visible and all other controls are not visible. • Users must set the topControl value to flip between the visible items and then call layout() method on the composite which has the StackLayout.
  • 98. • Be Local • Be Field
  • 99.
  • 101.
  • 102. Similarly add BottomComposite to “My Composite” catalog.
  • 103. • Similarly, create class BottomComposite • Similarly create class MainComposite: drag and drop to the main Finally, create a Java app by using the main composite !
  • 104. • Analysis of window.title
  • 105. JFace Viewer (makes coding life easier when creating Tables) • allows you to display a domain model in a standard SWT widget • E.g., list, combo, tree or table • without converting the domain model beforehand. • allows you to set a content provider which provides the data for the viewer and makes no assumption about the presentation of the data model. • You can also assign at least one label provider to a viewer so as to define how the data from the model will be displayed in the viewer. • Standard JFace viewer (ComboViewer, ListViewer, TreeViewer, TableViewer) • These viewers are part of the org.eclipse.jface.viewers package • Standard content provider (IStructuredContentProvider, ITreeContentProvider) • Standard label provider (ILabelProvider, CellLabelProvider) • JFace ComboViewer • The ComboViewer class simplifies the implementation of a SWT Combo (Drop-down box). https://www.vogella.com/tutorials/EclipseJFace/article.html#purpose-of-the-jface-viewer-framework
  • 106. • JFace TableViewer: • Content Provider: implements IStructuredContentProvider • Label Provider: implements ITableLabelProvider • JFace TreeViewer: • Content Provider: implements ITreeContentProvider • Label Provider: implements ITableLabelProvider • JFace Tree Table Viewer and more… http://wikiict.org/eclipse/eclipse-jface-tutorial/ More examples http://www.javased.com/index.php?api=org.eclipse.jface.viewers.TableViewer
  • 107. Model & Content/Label Provider • Please read the codes in the following java classes…and try to understand how/what they work/do. • AppMenu.java • Article.java • Employee.java • Department.java • DataModel.java • How to differentiate which provider should be implemented for the following java classes? • AbstractComboContentLabelProvider.java • AbstractTableContentLabelProvider.java • AbstractTreeContentLabelProvider.java • AbstractTreeTableContentLabelProvider.java
  • 108. JFace TableViewer • java classes: • AppMenu.java • Article.java • Employee.java • Department.java • DataModel.java • Provider: • AbstractComboContentLabelProvider.java • AbstractTableContentLabelProvider.java • AbstractTreeContentLabelProvider.java • AbstractTreeTableContentLabelProvider.java • Create TableViewerDemo.java File > New > Other... > WindowBuilder > SWT Designer > SWT > Application Window (注意import項目以及 修改List<Article>語法) Source folder: JFaceTutorial/scr Package: jfacetutorial.tableviewer Name: TableViewerDemo Create contents in: select "protected createContents() method“ > Finish • Create ArticleTableCLProvider.java extends AbstractTableContentLabelProvider (注意import項目以及png圖檔位置)
  • 109.
  • 110.
  • 111.
  • 112. // Get TableViewer data. List<Article> input = (List<Article>)tableViewer.getInput(); // Add row Article newArticle = .... ; input.add(newArticle); // Refresh row tableViewer.refresh(newArticle); // Or tableViewer.refresh(); // remove row input.remove(<article>);
  • 113.
  • 114. JFace Tree Viewer • java classes: • AppMenu.java • Article.java • Employee.java • Department.java • DataModel.java • Provider: • AbstractComboContentLabelProvider.java • AbstractTableContentLabelProvider.java • AbstractTreeContentLabelProvider.java • AbstractTreeTableContentLabelProvider.java • Create TreeViewerDemo.java File > New > Other... > WindowBuilder > SWT Designer > SWT > Application Window (注意import項目) Source folder: JFaceTutorial/scr Package: jfacetutorial.treeviewer Name: TreeViewerDemo Create contents in: select "protected createContents() method“ > Finish • Create AppMenuTreeCLProvider.java extends AbstractTreeTableContentLabelProvider (注意import項目)
  • 115. • In the case of a Tree with Column, you can set up the title of columns, but sometimes it is unnecessary.
  • 116.
  • 117. // Get data of TreeViewer. List<AppMenu> input = (List<AppMenu>)treeViewer.getInput(); AppMenu menu = input.get(0); List<AppMenu> childMenus = menu.getChildren(); // add AppMenu childMenus .add(newAppMenu); // Refresh treeViewer.refresh(menu ); // or treeViewer.refresh(); // Remove row similar.
  • 118.
  • 119. JFace Tree Table Viewer • java classes: • AppMenu.java • Article.java • Employee.java • Department.java • DataModel.java • Provider: • AbstractComboContentLabelProvider.java • AbstractTableContentLabelProvider.java • AbstractTreeContentLabelProvider.java • AbstractTreeTableContentLabelProvider.java • Create TreeTableViewerDemo.java File > New > Other... > WindowBuilder > SWT Designer > SWT > Application Window (注意import項目) Source folder: JFaceTutorial/scr Package: jfacetutorial.treetableviewer Name: TreeTableViewerDemo Create contents in: select "protected createContents() method“ > Finish • Create DeptEmpTreeTableCLProvider.java extends AbstractTreeTableContentLabelProvider (注意import項目)
  • 120.
  • 121.
  • 122.
  • 123. // Get data of TreeTableViewer. List<Department> input = (List<Department>)treeViewer.getInput(); Department dept = input.get(0); List<Employee> empList = dept.getEmployees(); // Add employee for Department. empList.add(newEmployee); // Refresh treeViewer.refresh(dept); // or treeViewer.refresh(); // Remove row similar.
  • 124.
  • 126. Creating Ant buildfiles • by default the Ant editor only has an association with build.xml named files. • as long as the file has a .xml extension, Eclipse will consider it to be a possible Ant buildfile • create a *.xml first • right click the *.xml • Add an association between *.xml and the Ant editor.
  • 127.
  • 129. hit Ctrl-Space to activate content assist
  • 130.
  • 131. Running Ant buildfiles • Any file with a .xml extension can be run as an Ant buildfile. • not all such files really are Ant buildfiles, but no harm is done if an attempt is made to mistakenly run a non-Ant .xml file as an Ant buildfile.
  • 132.
  • 133. Saving & Reusing Ant options • Creating multiple launch configurations in this manner allows you to quickly run your Ant buildfile in any configuration by simply specifying the corresponding launch configuration.
  • 134.
  • 135. • after Duplicate • Rename the file
  • 136.
  • 137. • The history is ordered so that the most frequently run configurations are at the top of the drop-down.
  • 138. Using the Ant view • The main advantage of this view is that you can work with all of your Ant buildfiles in one place, as opposed to hunting them down in one of the navigation views.
  • 139. Ant buildfiles as project builders
  • 140.
  • 141.
  • 142.
  • 143. • You can change the order so that your Ant buildfile runs before the Java builder, though that wouldn't make sense in this example. • The Java builder runs the internal Eclipse Java compiler which inturn is responsible for indexing your source so that searching, refactoring and many other features are available. • Thus it is not possible to replace the internal Eclipse Java compiler by using a project builder. You can disable the Java builder and you can control when the Java Builder runs with respect to the project builders that you define.
  • 144. Executing project builders • Try to create another Ant buildfile project
  • 145. Track Resource Changes to keep track of resource changes in the workspace (as the files and folders that have been added, modified, and removed from the workspace) interface org.eclipse.core.resources.*;
  • 146. public interface IResourceChangeEvent • According to Eclipse API Specification, there are currently 5+1 different types of resource change events • PRE_BUILD • POST_BUILD • POST_CHANGE • PRE_CLOSE • PRE_DELETE • PRE_REFRESH https://help.eclipse.org/kepler/nftopic/org.eclipse.platform.doc.isv/referenc e/api/org/eclipse/core/resources/IResourceChangeEvent.html https://www.wideskills.com/eclipse-plugin-tutorial/eclipse- plugin-track-resource-changes-tutorial
  • 147. PRE_BUILD • Before-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is PRE_BUILD, and getDelta returns the hierarchical delta rooted at the workspace root. The getBuildKind method returns the kind of build that is about to occur, and the getSource method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties immediately before each build operation. If autobuilding is not enabled, these events still occur at times when autobuild would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during a PRE_BUILD callback must be done in the thread doing the notification.
  • 148. POST_BUILD • After-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is POST_BUILD, and getDelta returns the hierarchical delta rooted at the workspace root. The getBuildKind method returns the kind of build that occurred, and the getSource method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties at the end of every build operation. If autobuilding is not enabled, these events still occur at times when autobuild would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during a POST_BUILD callback must be done in the thread doing the notification.
  • 149. POST_CHANGE • After-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is POST_CHANGE, and getDelta returns the hierarchical delta. The resource delta is rooted at the workspace root. These events are broadcast to interested parties after a set of resource changes and happen whether or not autobuilding is enabled. The workspace is closed for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event.
  • 150. PRE_CLOSE • Before-the-fact reports of the impending closure of a single project. Event type is PRE_CLOSE, and getResource returns the project being closed. The workspace is closed for change during notification of these events. • Before-the-fact reports of the impending deletion of a single project. Event type is PRE_DELETE, and getResource returns the project being deleted. The workspace is closed for change during notification of these events. PRE_DELETE
  • 151. • Before-the-fact reports of the impending refresh of a single project or the workspace. Event type is PRE_REFRESH and the getSource method returns the scope of the refresh (either the workspace or a single project). If the event is fired by a project refresh the getResource method returns the project being refreshed. The workspace is closed for changes during notification of these events. PRE_REFRESH
  • 152. public interface IResourceChangeListener extends EventListener void resourceChanged (IResourceChangeEvent event) • To modify PropertyManagerView so as to implement IResourceChangeListener and use IResourceChangeEvent to update itself.
  • 153. public interface IResourceDelta extends IAdaptable • A resource delta represents changes in the state of a resource tree between two discrete points in time. • To modify PropertyManagerView so as to implement the IAdaptable interface; extensions are managed by the platform's adapter manager.
  • 154. EGit • Help > Install new Software • …complete the installation http://download.eclipse.org/egit/updates https://wiki.eclipse.org/EGit/User_Guide http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html 若無法安裝可取消勾選,否則重新安裝更新版的Eclipse
  • 155. setting up EGit • Window > Preferences or change the Default repository folder
  • 156.
  • 157. Working with a local Git repository • create a new Java project and a package • add one sample class like following • select the project > Team > Share Project
  • 158. • It is recommended to place your Git repositories outside the Eclipse workspace. After pressing the Finish button in create dialog, the wizard displays the settings for your local Git repository. • Select the Finish button again to put your repository under Git version control. • You have created a local Git repository. The Git repository is in this case directly stored in the specified folder in a .git folder.
  • 159. • Window > Perspective > Open Perspective > Team Synchronizing • Creating a file .gitignore in the project folder with the following content:
  • 160. • A gitignore file specifies intentionally untracked files that Git should ignore. • Files already tracked by Git are not affected. • All files and directories which apply to the pattern described in this file will be ignored by Git. In this example all files in the bin and the .metadata directory will be ignored.
  • 161. • Using the Git Staging view drag only the all files you want to commit into the Staged Changes area, write a meaningful commit message and press the commit button. • Right click the project > Window > Show View > Team > History • Alt+Shift+W shortcut > History
  • 162. • dirty (folder) - At least one file below the folder is dirty; that means that it has changes in the working tree that are neither in the index nor in the repository. • tracked - The resource is known to the Git repository and hence under version control. • untracked - The resource is not known to the Git repository and will not be version controlled until it is explicitly added. • ignored - The resource is ignored by the Git team provider. The preference settings under Team -> Ignored Resources, "derived" flag and settings from .gitignore files are taken into account. • dirty - The resource has changes in the working tree that are neither in the index nor in the repository. • staged - The resource has changes which have been added to the index. Note that adding changes to the index is currently possible only in the commit dialog via the context menu of a resource. • partially-staged - The resource has changes which are added to the index and additional changes in the working tree that neither reached the index nor have been committed to the repository. See partial staging from the Git Staging view for how to do that. • added - The resource has not yet reached any commit in the repository but has been freshly added to the Git repository in order to be tracked in future. • removed - The resource is staged for removal from the Git repository. • conflict - A merge conflict exists for the file. • assume-valid - The resource has the "assume unchanged" flag. This means that Git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell Git when you change the working tree file. The button's icon changes depending on the selected mode. http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html#egit-Inspecting-State-Of-Repository
  • 163. • to add an existing local Git repository to the view, • to clone a Git repository • to create a new Git repository The button's icon changes depending on the selected mode.
  • 164. • The content area shows the existing Git repositories and the structural elements of this view. • A right-click (context menu) on an element in the Git repository view allows you to perform related Git operations.
  • 165. Cloning Remote Repositories • File > Import • then, go to https://git.eclipse.org/
  • 166. • enter the location of the remote repository. • note: URI, Host and Repository path may be different
  • 167. • choose which branches shall be cloned from the remote repository. • define where you want to store the repository on the local file system and define some initial settings. • note: The default is "origin"
  • 168.
  • 169. Performing Git operations • Once you have placed a project under version control you can start using team operations on your project. • The team operations are available via right-click on your project or file.
  • 170. The most important operations are described in the following list. Select: • Team -> Add to index, to add the selected resource(s) to the index of Git • Team -> Commit, to open the commit dialog for committing to your Git repository • Team -> Create Patch..., to create a patch • Team -> Apply Patch..., to apply a patch to your file system • Team -> Ignore, to add the file to a .gitignore file • Team -> Show in History, to display the selected files and folders in the History view • Team -> Pull to pull in changes from your remote Git repository • Team -> Fetch to fetch the current state from the remote repository • Team -> Switch To to switch or create new branches. • Team -> Push to push changes to your remote Git repository • Team -> Tag to create and manage tags. http://javaandeclipse.blogspot.com/p/egit-and-eclipse.html#egit-PerformingGitOperations
  • 171. • If you recognize that you missed something when committing a change you may fix this: open the staging view or commit dialog again and specify that the current commit shall "amend" the previous commit in the current branch. • note: do NOT amend commits if they have already been published to a shared repository since this may disturb others if they already based their changes on the published change. drag
  • 173. • You may switch back to ‘master’ • select the branch to rename • enter the new branch name > OK
  • 174. • two alternative ways to Rename Branch… • Deleting a Branch takes the same three ways to complete as mentioned above when renaming a branch. • The currently checked out branch can not be deleted • If deletion of the branch may result in data loss, a warning is displayed that must be confirmed
  • 175. Merging • A merge include changes from another branch or tag, since the time their histories diverged from the current branch, into the currently checked out branch.
  • 176. • A merge can result in conflicts which require user action. • select the top level resource showing the red conflict label decorator. • click Team -> Merge Tool • select the merge mode Use HEAD (the last local version) of conflicting files and click OK • more details about how conflicts are presented: https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git- merge.html#_how_conflicts_are_presented • Ways to resolve the conflicts: • Using Merge Tool • Manually editing the conflicting resource by telling EGit (Team > Add) to resolve the conflict (Team > Commit) • Finding conflicting files to resolve the conflicts. • Committing or Aborting a merge
  • 177. Rebasing • The Git Repositories view allows you to rebase your currently checkout branch onto another branch. • If the rebase was successful a dialog is shown. • You have to resolve rebase conflicts if they occur. • if you want to cancel the rebase operation select Rebase -> Skip and Rebase -> Abort.
  • 178.
  • 179. • You may also reset to specific branch or tag: Select Team -> Reset... on a project (or (Repositories view or History view) • You may also revert all local and staged changes: reset to the current HEAD by using a hard reset. (right click on a project or Repositories view or History view) • soft - the HEAD points now to the new commit, the index and the working tree are unchanged. • mixed - the HEAD points now to the new commit, the index is updated, the working tree is unchanged. • hard - the HEAD points now to the new commit, the index and the working tree are updated
  • 180. More details about EGit, please open Eclipse > Help > EGit Documentation > EGit User Guide
  • 181. Builders, Markers and Natures https://www.wideskills.com/eclipse-plugin-tutorial/eclipse-builders-natures-and-markers
  • 182. • builders are used to take java source as input and generate corresponding class files • Incremental Builders - These contribute to performance improvement by rebuilding only the delta since last full build. • markers are used to mark error locations, warnings, book marks etc. in (Java) editor. • natures are used to link project with various functionalities such as builders in a project. • For ex: if we add java nature to a project inside eclipse. It associates project with incremental java compiler. natures are added in .project file of the project.
  • 183. Creating Builders Nature using existing templates • an builder's (incremental) name: sample builder • this builder validates XML file and if required adds a problem marker to problematic xml files • this builder will run only for projects which have declared themselves as having sample nature projects • Creating a plug-in project first ! File > New > Project… > Plug-in Development > Plug-in Project > MANIFEST.MF
  • 184. • Create a xml file.
  • 185. Eclipse Builders • New builder is created by extending the org.eclipse.core.resources.builders extension point. • ID and name are used to give builder a data value and name respectively. • the builder element. • the hasNature attribute flags whether this builder is associated with any nature. • the run element. • the class attribute • here we specify the actual java class which provides the functionality of the builder.
  • 186. IncrementalProjectBuilder • the java class (testplugin.builder.SampleBuilder) needs more attention as this is the class which is doing the actual work. • Any builder class must be a subclass of IncrementalProjectBuilder. • All builders must subclass this class according to the following guidelines: • Subclasses should implement the build method of this class • Subclasses may implement remaining methods • Subclasses should supply a public and NO arg constructor • More details about class IncrementalProjectBuilder https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv /reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html
  • 187. • The build method requires special attention as well. • This method of the builder is called whenever build is required
  • 188. build (int kind, Map args, IProgressMonitor monitor) we are using kind parameter to understand the kind of build request. • kind: what kind of build is required? • kind parameter could be a FULL_BUILD, INCREMENTAL_BUILD, and AUTO_BUILD. • args: a Map to pass arguments/information to builder. • monitor: a progress monitor • Eclipse will call build method of the builder whenever any type of build is required. • Here has implemented two methods for each kind of build • full build • incremental build
  • 189. • we are delegating calls to Visitors. • visitor will visit all the resources (in case of delta only the modified resources since last build). • For each resource we are calling checkXML() method. • CheckXML method essentially delegates call to XMLErrorHandler defined in builder class which will check if XML document is well formed or not. • In case it is not well formed it will create a marker (as shown below).
  • 190. Markers • There are many types of predefined markers defined as constants in IMarker interface. • org.eclipse.core.resources.bookmarkIMarker.BOOKMARK org.eclipse.core.resources.markerIMarker.MARKER org.eclipse.core.resources.problemmarker IMarker.PROBLEM org.eclipse.core.resources.taskmarkerIMarker.TASK org.eclipse.core.resources.textmarkerIMarker.TEXT
  • 191. IMarker • New marker is created by extending org.eclipse.core.resources.markers extension point. • ID and Name are datavalue and name respectively. • Next, we need to define the super type marker for new marker. • Since we want to show errors in Problems View we are using org.eclipse.core.resources.problemmarker as supertype. IMarker is the main interface when we are dealing with eclipse markers. • Next is the persistent element. • Since we want this markers to persist across eclipse sessions we are setting this property to true.
  • 192. • addMarker method in SampleBuilder class is used to show above defined marker in the editor whenever problem/error occurs. • more details about IMarker interface https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2F reference%2Fapi%2Forg%2Feclipse%2Fcore%2Fresources%2FIMarker.html
  • 193. Natures • Natures are not only used to associate builders but are also used to define many other functionalities • for ex: only java nature projects are shown in Package Explorer. • Some of the predefined natures are org.eclipse.jdt.core.javanature,org.eclipse.pde.PluginNature. • Nature is created by extending org.eclipse.core.resources.natures extension point. • ID is the unique identifier for this nature. • Name is the human readable name of the nature.
  • 194. • Next element is the builder. Here we will add a builder to this nature. • We have associated SampleBuilder created earlier with this nature. So that projects with SampleNature use SampleBuilder whenever an XML file is saved.
  • 195. • Next elements are runtime and run. Here we will specify a class named SampleNature which will be used to configure/deconfigure project with Sample Nature. • With the help of this class we will be able to configure non Sample Nature project to Sample Nature project at run time. • OR we will be able to convert Sample Nature Project to non Sample Nature project. • Repercussions of making a Project as Sample Nature project will be that a Sample builder will be attached to project which will run whenever an XML file is saved and will look for any errors in XML.
  • 196. IProjectNature • It can configure a project with the project nature, or de-configure it. • Please refer to Eclipse API Specification to know more about this class. • Here, user is provided with toggle action to convert non Sample Nature project to Sample Nature project. Following method from SampleNature class will be called to associate the project with SampleNature. • Every workbench project contains a .project file that contains build commands. Executing above method causes the following to appear in the buildSpec section of the project's .project file. Also Sample nature is added in natures section. https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/ reference/api/org/eclipse/core/resources/IncrementalProjectBuilder.html
  • 197.
  • 199. The Eclipse help system • uses a browser-based presentation and therefore has full support for HTML. • search is automatically included in the help system • context help and keyword index are supported if you provide the appropriate content files. 1. Create a Rich Client Application • File > New > Project... > Plug-in Project 2. Create a Product Configuration 3. Add Source Code 4. Test 5. Add Required Plug-ins 6. Test Again 7. Add Sample Help Content 8. Add Context Help Support 9. Test context help 10. Setting Help Preferences
  • 200.
  • 201. 2. Create a Product Configuration • Switch to the Plug-in Development perspective • Select "File > New > Product Configuration" from the main menu. • Select "org.eclipse.helprcp" in the resulting "New Product Configuration" wizard page. • Input "helprcp.product" into the "File name" text box. • Select the "Use an existing product" radio button inside the "Initialize the file content" group and click "Finish". The "Product Configuration Editor" will open.
  • 202. 2. Create a Product Configuration (continued) • Input "Help RCP Application" into the "Product Name" text box. • Verify "org.eclipse.helprcp.product" is the default value in the "Product ID" drop down menu. • Select "File > Save" from the main menu. • From the "Overview" tab of the "Product Configuration Editor" click on "Launch an Eclipse Application" and verify that the application launches.
  • 203. 3. Add Source Code • make a few source changes to add the help actions to the menu. • add the lines marked "// NEW" to the class • add the lines marked "// NEW" to function "ApplicationActionBarAdvisor.makeActions()" • add the lines marked "// NEW" to function "ApplicationActionBarAdvisor.fillMenuBar()" https://www.eclipse.org/articles/article.php ?file=Article-AddingHelpToRCP/index.html 4. Test Launch the application from the "Product Configuration Editor" > Help > now has additional entries but neither of them does anything. This is because we still need to import the plug-ins that comprise the Eclipse help system.
  • 204. 5. Add Required Plug-ins 1) Click the “product configuration" link in the Overview tab 2) Add "org.eclipse.help.webapp" and "org.eclipse.help.ui" to the list in the "Plug-ins and Fragments" section. 3) Click the "Add Required Plug-ins" button. 4) Select the checkbox to "Include optional dependencies when computing required plug-ins". • If you omit this step the help system will not have all the plug-ins it needs and you will see an exception at startup. 5) Select "File > Save" from the main menu.
  • 205.
  • 206.
  • 207. • https://www.wideskills.com/eclipse-plugin-tutorial/eclipse-plugin- help-tutorial • https://www.codeproject.com/Articles/1257687/Documenting-Your- Project-Using-the-Eclipse-Help-Sy • https://www.vogella.com/tutorials/EclipseRCPHelpSystem/article.htm l • https://www.ibm.com/support/pages/creating-help-plug-ins-and- adding-rational-help-content
  • 208. Custom Text Editor Eclipse provides rich support for creating editors that operate on text, such as programming language editors or document editors.
  • 209. • change font style for a text file • change text color by modifying the Appearance color options for Foreground and Background color https://stackoverflow.com/questions/59251808/changing-font-and-colour-of-text-in-eclipse-text-editor
  • 210. various plug-ins that provide facilities for text processing • org.eclipse.text: provides a model for manipulating text and has no visual components, so it can be used by headless programs that process or manipulate text. • org.eclipse.swt: the class StyledText is the SWT user-interface object for displaying and editing text. Everything the user sees is rooted here: colors, fonts, selections, the caret (I-beam cursor), and more. You can add all kinds of listeners to this widget to follow what the user is doing. It also supports some fancier features, such as word wrapping and printing. • org.eclipse.jface.text: This is the marriage of the model provided by org.eclipse.text and the view provided by StyledText. It is the heart of the text framework. • org.eclipse.ui.workbench.texteditor: You can't use the features provided here without being part of a running Eclipse workbench. It supports text editors that appear in the workbench editor area and features a large collection of Action subclasses for manipulating the contents of an editor, as well as support for annotations, incremental search, and more. • org.eclipse.ui.editors: It provides the main concrete editor in the base Eclipse Platform, the default text editor. • and more text infrastructures… https://wiki.eclipse.org/FAQ_What_support_is_there_for_creating_custom_text_editors%3F
  • 211. All editors start by making a subclass of EditorPart from the org.eclipse.ui.part package. • create a plug-in project • add one or more new extensions by using Extension Wizards • MANIFEST > Extension > Add > Extension Wizard > Editor or Extensible Editor… • E.g., a simple XML Editor will be created > go to “src” folder > search XMLEditor and XMLConfiguration java classes > modify the constructor of the XMLEditor class > modify XMLConfiguration class • note: debug a little bit by yourself; since it is an XML Editor, only quoted strings should be spell checked and the XML tags should be skipped. http://blog.ankursharma.org/2009/08/adding-spellchecking-to-custom-editors_19.html
  • 212. • If you are using a product, add your new plug-ins (org.eclipse.core.contenttype.contentTypes and org.eclipse.ui.editors) to your feature and start a runtime Eclipse via the product. • set the preferenceStore for checking dictionary and other preferences from Window > Preferences > General > Editors > Text Editors > Spelling . https://www.vogella.com/tutorials/EclipseEditors/article.html
  • 213. Useful and Interesting resources • http://help.eclipse.org/2019- 09/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/editors_highlighting.htm • https://marketplace.eclipse.org/category/free-tagging/editor • https://marketplace.eclipse.org/category/free-tagging/structured-text • https://www.eclipse.org/efxclipse/index.html • https://www.jotform.com/widgets/category/text-editor
  • 214. Rich Text Editor • Help -> Install New Software... • Add a new site using the url http://static- tmsoftstudio.appspot.com/richtexteditor to the Eclipse Update Manager. • Select the bundles from the list that you would like to install and click Next. https://marketplace.eclipse.org/content/rich-text-editor/help https://projects.eclipse.org/projects/technology.dltk/releases/6.0 Note: Eclipse Dynamic Languages Toolkit 5.11 is a part of Eclipse IDE 2019-09
  • 215. Graphical Editing Framework (GEF) 圖形化編輯框架 (org.eclipse.gef) - an interactive MVC framework built on top of Draw2d
  • 216. The Common component provides key concepts and infrastructure to be potentially used by all other GEF components https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.gef.layout.doc%2Freference%2Fwiki%2FLayout.html
  • 218. • an open source framework dedicated to providing a rich, consistent graphical editing environment for applications on the Eclipse Platform • https://wiki.eclipse.org/GEF/Developer_FAQ • GEF (MVC) is interactive model-view- controler fraDraw2d-based graphical editors mework, which fosters the implementation of SWT-based tree and for the Eclipse Workbench UI. • https://www.eclipse.org/gef/gef_mvc/ • https://www.eclipse.org/gef/ • Download GEF update 5.3.0 (latest *.zip) • https://www.eclipse.org/gef/download.php?fil e=/tools/gef/downloads/drops//5.3.0/I201912 070301/GEF-Update-5.3.0.zip • https://www.eclipse.org/gef/downloads/index .php?showAll=1&hlbuild=S201905091638 • https://projects.eclipse.org/projects/tools.gef
  • 219. • After complete the install, follow the steps on this page • https://github.com/eclipse/gef#eclipse-graphical-editing-framework-gef • Set up an Eclipse IDE • Set up a Target Definition containing GEF • Run the examples • Other resources • https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.gef.doc.isv%2F guide%2Fguide.html • https://www.eclipse.org/articles/Article-GEF-diagram-editor/shape.html