Eclipse JDT Tutorial – Dynamic load Java projects to workspace

In previous post, I have shown how to use Java Model to create a new project, access an existing project, and dynamically import/load an existing project directory into workspace. The real question is if we want to parse a large number of projects(e.g. 1000) and those projects do not have .project file under it’s directory. … Read more

Add JDBC Database Connection to an Eclipse Plug-in

When you add JDBC database connection to an Eclipse plug-in, you may get the following error message: Error message(partial): java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) You may check again and again if the JDBC library has already added to the build path. That will not work, because JDBC … Read more

Eclipse JDT tutorial – Java Search Engine – A Simple Working Example

This article belongs to Eclipse JDT Tutorial Series. JDT Java Search Engine provides a function to quick search Java projects in the workspace for Java elements, such as method references, field declarations, implementors of an interface, etc. There are mainly 4 steps involved with a search: Create a search pattern Create a search scope Define … Read more

Eclipse JDT tutorial – Java Model – Concept and Design

This article belongs to Eclipse JDT Tutorial Series. What is Java Model? The Java model is the set of classes that model the objects associated with creating, editing, and building a Java program. It is defined in org.eclipse.jdt.core package. Accordingly, non-API classes are defined in package org.eclipse.jdt.internal.core. You will see their relation in next section. … Read more

Eclipse RCP Tutorial: Commonly-used Eclipse Workbench Extension Points

1. What is a Workbench? The following diagram is from eclipse official site. In brief, when you open your eclipse, what you see is a workbench. It consists of a menu bar, a tool bar, a page which is composed by one or more views/editors. 2. Commonly Used Extension Points The following are commonly or … Read more

Decipher Eclipse Architecture: IAdaptable – Part 1 – Brief Introduction

If you read Eclipse source code, you will find that IAdaptable is a very popular interface which is implemented by many others. Why do so many classes/interfaces implement IAdaptable? The answer is that Adapter is the core design pattern for eclipse Core Runtime. What is IAdaptable? public interface IAdaptable { /** * Returns an object … Read more

Eclipse RCP Tutorial: How to Add a Progress Bar

This tutorial is about eclipse Job and it consists two parts. The first part introduces how to make a progress bar by using a simple example. The second part briefly illustrates Eclipse Job for background processing. 1. A Simple Example of Progress Bar in Eclipse Suppose you have a working RCP application with a sample … Read more

Eclipse RCP Tutorial: Export Eclipse RCP Application to be a Product

To develop a standalone desktop GUI application by using eclipse RCP, exporting it to be a product is necessary. This tutorial is about how to use the Eclipse Product export wizard to generate executable stand-alone desktop application. This article assumes that you know how to build a plug-in project by using eclipse RCP wizard. Here … Read more

Blocking, nonblocking, asynchronous, buffered, unbuffered, double buffered, programmed I/O, DMA

Here are all I/O related concepts. Blocking I/O: process is blocked until all bytes are ready. Non-blocking I/O: the OS only reads or writes as many bytes as is possible without blocking the process. Asynchronous I/O: similar to non-blocking I/O. The I/O call returns immediately, without waiting for the operation to complete. I/O subsystem signals … Read more

Steps Involved in Making a System Call

System call is programming interface to the services provided by the OS. It is typically written in a high-level language such as C or C++. The steps for making a system call: 1) push parameters on stack 2) invoke the system call 3) put code for system call on register 4) trap to the kernel … Read more

Type Checking for Object Oriented Features

Type checking is the activity of ensuring that the operands of an operator are of compatible types. This post is about how object oriented features such as inheritance, overloading and overriding affect type checking. A type error occurs when an argument of an unexpected type is given to an operation. It can be signalled at … Read more

Static Storage vs Heap vs Stack

The following is the summary of compiler storage allocation. 1. Static vs Dynamic Static: Storage can be made by compiler looking only at the text of the program. One reason for statically allocating as many data objects as possible is that the addresses of these objects can be compiled into target code. Dynamic: Storage can … Read more

How Static Type Checking Works in Java?

From Wiki: Static type-checking is the process of verifying the type safety of a program based on analysis of a program’s source code. Dynamic type-checking is the process of verifying the type safety of a program at runtime Java uses static type checking to analyze the program during compile-time to prove the absence of type … Read more