Tuesday, September 16, 2008

NavigationHistory and INavigationLocation

How to navigate in Eclipse:

Internally org.eclipse.ui.internal.NavigationHistory maintain all the navigation history.

- create EditorPart implement the INavigationLocationProvider
- add a new INavigationLocation to history by sending a message to NavigationHistory.markLocation(IEditorPart part)

Thursday, May 29, 2008

How to use ASTParser in EMF

EMF has an example of how to use org.eclipse.jdt.core.dom.ASTParser to analyze the source code.

Please refer to org.eclipse.emf.test.tools.merger.ASTTest.testRead()/testWrite().

TO check out the source code from CVS repository:
dev.eclipse.org:/cvsroot/modeling/org.eclipse.emf.test.tools

The test also shows how JMerger works.

Following is a code fragment:
...
String content = TestUtil.readFile(javaSourceFile, false);

ASTParser astParser = ASTParser.newParser(AST.JLS3);
astParser.setSource(content.toCharArray());
CompilationUnit compilationUnit = (CompilationUnit)astParser.createAST(null);

{
Javadoc javadoc = (Javadoc)compilationUnit.getCommentList().get(0);
assertEquals(1, javadoc.tags().size());
TagElement tagElement = (TagElement)javadoc.tags().get(0);
assertEquals(9, tagElement.fragments().size());
....

Eclipse DB plugins

quantum SQL editor

Wednesday, December 12, 2007

PDE builder and DEBUG

6 Great Links for Eclipse Build Automation with PDE Build

http://eclipsenuggets.blogspot.com/2007/09/6-great-links-for-eclipse-build.html

Getting Auto-Resizing TableColumns the Easy Way


Build update site: http://dev.eclipse.org/newslists/news.eclipse.platform/msg25629.html

TO DEBUG:

Create Debug Launch Configuration
  1. §Select “Debug as >Ant Build..” from context menu of PDE Build’s scripts\build.xml file in the package explorer. Select the second Ant Build.
  2. §Select the “Main” tab and set the Base Directory to ${workspace_loc:/org.eclipse.pde.build/scripts}
  3. §Select the Build tab and deselect Build before launch
  4. §Select the JRE tab and select Run in the same JRE as the workspace.
  5. §Select the “Properties” tab
  6. §Deselect Use Global properties…”.
  7. §Add a property named “builder”. Set value to the path to the root of the jdt-builder-sample project on your file system.
  8. §Add a property “eclipse.running”. Set value to “true” if not already set.
  9. §Click Debug. Run to each breakpoint or step through as you wish.
TIP 1: set "outputUpdateJars=false"
Otherwise, all pluins will be exported as jar. Even the native library fragments, then Eclipse can not find the *.dll *.so from the jar, then built product can not startup.
The error message will be :
*The executable launcher was unable to locate its companion shared library*
Which implies that either that launcher fragment does not exist, or that it is not in folder form (the launcher can't get the library out of a jar).

Sunday, December 02, 2007

Eclipse source viewer

Eclipse content assistant proposal tutorial :
http://www.ibm.com/developerworks/opensource/library/os-ecca/

http://www.blogjava.net/reloadcn/archive/2006/10/09/74150.html

用Eclipse RCP & ECF 实现 Google Talk客户端
http://www.blogjava.net/reloadcn/archive/2006/10/09/ecf2.html

Monday, November 12, 2007

How to show build ID on splash.

Eclipse allows to adding ID to the splash:
- plugin_customization.ini : org.eclipse.ui.workbench/SHOW_BUILDID_ON_STARTUP=true
- .product -> Launching->VM Arguments: -Declipse.buildId=2.0.0

Wednesday, August 01, 2007

Eclipse widget: Dialog

Create a custom filtered items selection dialog: FilteredItemsSelectionDialog
There is an example in the Eclipse online help.

Friday, April 20, 2007

Eclipse FTP and WebDAV support

support FTP.