Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Monday, July 4, 2022

How to show a progress monitor on eclipse rcp splash screen

Create plugin_customization.ini in your product branding plugin with the following property

# show progress on startup

org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true



Add plugin_customization.ini in plugin.xml property extension


<plugin>

   <extension

         id="myid"

         name="my-IDE"

         point="org.eclipse.core.runtime.products">

      <product

            application="org.eclipse.ui.ide.workbench"

            description="About product description"

            name="%product.name">

         <property

               name="appName"

               value="my-IDE">

         </property>

         

    <property

               name="preferenceCustomization"

               value="plugin_customization.ini">

        </property>

      </product>

   </extension>

</plugin>


To control the coordinates of the progress monitor and message on the splash screen add the following three properties

      <property

           name="startupForegroundColor"

           value="000000">

     </property>

     <property

           name="startupMessageRect"

           value="7,305,285,20">

     </property>

     <property

           name="startupProgressRect"

           value="7,290,490,15">

     </property>


In Eclipse 3.x RCP applications, this could be done directly from the .product splash screen page





Thursday, February 11, 2021

Installing features in eclipse from command line

We can install eclipse features from the command line also. Here is an example, where I am going to install esp-idf eclipse plugin into my eclipse cdt

Go to the command line
Go to the eclipse directory and run the below command

Installing a single feature
$ eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ -installIU com.espressif.idf.feature.feature.group

This installs com.espressif.idf.feature.feature.group feature from  https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ repository

$ eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/swtchart/releases/0.13.0 -installIU org.eclipse.swtchart.feature.feature.group

To install multiple features at the same time.
$eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/ -installIU ,com.cthing.cmakeed.feature.feature.group,ilg.gnumcueclipse.debug.gdbjtag.openocd.feature.feature.group



Resources:

Monday, October 19, 2020

Icon editor for resizing and creating new icons

 http://www.xiconeditor.com/

This is a simple icon editor which I'm using these days for resizing and creating new icons for the eclipse plugin

Friday, April 17, 2020

Eclipse CDT based products

For my reference, I found this article very useful.
https://www.eclipse.org/community/eclipse_newsletter/2017/october/article2.php

Espressif joined the league by providing the Eclipse Plugin for ESP-IDF for developing ESP32 IoT applications.

Check here https://github.com/espressif/idf-eclipse-plugin


Tuesday, April 7, 2020

Eclipse launchbar preference storage

/Users/usern-name/runtime-EclipseApplication/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs

Eclispe CDT indexing cache

/Users/kondal/runtime-EclipseApplication95/.metadata/.plugins/org.eclipse.cdt.core/infoCache

Thursday, January 23, 2020

IoT Embedded CDT


(Eclipse CDT+ GNU MCU Eclipse) is shaping up as an "Eclipse Embedded CDT"

https://projects.eclipse.org/projects/iot.embed-cdt
https://gnu-mcu-eclipse.github.io/debug/openocd/

Eclipse Team is planning to put together eclipse CDT and gnu mcu eclipse plugins as a single package so that it will be easy for IoT and Embedded developers - they can just download a single package and get started with IoT.

Thursday, December 19, 2019

Eclipse CDT: How to exclude certain folders for not showing error markers

If you want to avoid certain syntax and semantic errors not be reported on a particular folder in your Eclipse CDT project.

Here you go!

Eclipse CDT Code Analysis Plugins

org.eclipse.cdt.codan.core
org.eclipse.cdt.codan.core.cxx
org.eclipse.cdt.codan.ui
org.eclipse.cdt.codan.ui.cfgview
org.eclipse.cdt.codan.ui.cxx

Wednesday, November 27, 2019

Interesting article on improving Eclipse CDT Indexing



  • Performance Improvement of roughly 37%!
  • It used weak references which are garbage collected as soon as heap size becomes sparse

Tuesday, June 4, 2019

Where does eclipse CDT stores CMake toolchain information?

CDT stores cmake toolchain information as part of org.eclipse.cdt.cmake.core.prefs file.

/Users/kondal/runtime-EclipseApplication6/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.cmake.core.prefs

For example, here is the content of the file 


cmakeToolchains/14/__path=/Users/kondal/esp/esp-idf/tools/cmake/toolchain-esp32.cmake
cmakeToolchains/14/cdt.toolChain.id=gcc-xtensa-/Users/kondal/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
cmakeToolchains/14/cdt.toolChain.type=org.eclipse.cdt.build.gcc
cmakeToolchains/n=15
eclipse.preferences.version=1

To understand more how eclipse store preferences:
https://gnu-mcu-eclipse.github.io/developer/eclipse/runtime-preferences/

Tuesday, October 2, 2018

Eclipse Simultaneous Release 2018-09 is now "Eclipse 4.9"

I was expecting Eclipse 4.9 sometime during June, 2019 as part of the Eclipse annual release cycle. It's kind of surprising for me when I heard about Eclipse Simultaneous Release 2018-09 (SimRel 2018-09 ) is now called as "Eclipse 4.9

Each annual release typically occurs in June, with follow-up update releases in September (*.1), December (*.2), and March (*.3). 

Whatever, let's welcome "Eclipse 4.9" and it's time for one more upgrade!


Here are New and Noteworthy changes in the Eclipse 4.9
http://www.eclipse.org/eclipse/news/4.9/

More FAQ's here on the naming convention for Simultaneous Release:
https://wiki.eclipse.org/SimRel/Simultaneous_Release_Cycle_FAQ


More interesting part is here from the above link:


The releases will be named following the pattern year.month: SimRel YYYY-MM.
For instance SimRel 2018-09SimRel 2018-12SimRel 2019-03SimRel 2019-06
Note that unlike past years, the name will no longer change annually with an alphabetically increasing name (Kepler, Luna, Mars, Neon, Oxygen, Photon) but will instead remain the singular name of the train.
See the discussion in Bugzilla : https://bugs.eclipse.org/bugs/show_bug.cgi?id=532220.

Tuesday, August 8, 2017

Showing progress dialog using Eclipse jobs API

Below piece of code shows how can we run the eclipse jobs interactively by showing eclipse progress dialog using Eclipse Jobs API.

Job installationJob = new Job("Creating a new creating catalog...")
{
@Override
public IStatus run(IProgressMonitor monitor)
{
try
{
monitor.beginTask("creating catalog...", 10);
//do your task here
}
finally
{

monitor.done();
}
return Status.OK_STATUS;
}
};

installationJob.setPriority(Job.INTERACTIVE);

//This is alternative to the installationJob.setUser(true);
//sometimes setUser(true) doesn't show up the progress dialog, in those cases below piece of code can be used.

PlatformUI.getWorkbench().getProgressService()
.showInDialog(Display.getDefault().getActiveShell(), installationJob);

installationJob.schedule();

Thursday, June 8, 2017

Programmatically executing a command in eclipse


If you know the eclipse command and you want to execute that in the programmatical way, you need to use IHandlerService.

Below is the example to perform toggle full-screen command from eclipse.


IHandlerService handlerService =
 (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);

if (handlerService == null)
{
                 return null;
}

try
{
   handlerService.executeCommand("org.eclipse.ui.cocoa.fullscreenWindow", null);
}
catch (Exception ex)
{
//log exception

}

Tuesday, May 16, 2017

Debugging options for org.eclipse.osgi

#### Debugging options for org.eclipse.osgi

# Turn on general debugging for org.eclipse.osgi
org.eclipse.osgi/debug=false
# Prints out class loading debug information
org.eclipse.osgi/debug/loader=false
# Prints out event (FrameworkEvent/BundleEvent/ServiceEvent) and listener debug information
org.eclipse.osgi/debug/events=false
# Prints out OSGi service debug information (registration/getting/ungetting etc.)
org.eclipse.osgi/debug/services=false
# Prints out bundle manifest parsing debug information
org.eclipse.osgi/debug/manifest=false
# Prints out LDAP filter debug information
org.eclipse.osgi/debug/filter=false
# Prints out security (PermissionAdmin service) debug information
org.eclipse.osgi/debug/security=false
# Prints out start level service debug information
org.eclipse.osgi/debug/startlevel=false
# Prints out package admin service debug information
org.eclipse.osgi/debug/packageadmin=false
# Prints out timing information for bundle activation
org.eclipse.osgi/debug/bundleTime=false
# Debug the loading of message bundles
org.eclipse.osgi/debug/messageBundles=false
# Debug the object pool additions
org.eclipse.osgi/debug/objectPool/adds=false
# Debug the object pool duplications
org.eclipse.osgi/debug/objectPool/dups=false

# Eclipse adaptor options
org.eclipse.osgi/eclipseadaptor/debug = false
org.eclipse.osgi/eclipseadaptor/debug/location = false
org.eclipse.osgi/eclipseadaptor/debug/cachedmanifest = false
org.eclipse.osgi/eclipseadaptor/debug/platformadmin=false
org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver=false
org.eclipse.osgi/eclipseadaptor/converter/debug = false

### OSGi resolver options
# Turns on debugging for the resolver
org.eclipse.osgi/resolver/debug = false
# Prints out wiring information after the resolver has completed the resolve process
org.eclipse.osgi/resolver/wiring = false
# Prints out Import-Package information
org.eclipse.osgi/resolver/imports = false
# Prints out Require-Bundle information
org.eclipse.osgi/resolver/requires = false
# Prints out debug information form the "uses" clause
org.eclipse.osgi/resolver/uses = false
# Prints out cycle information
org.eclipse.osgi/resolver/cycles = false
# Prints out Eclipse-GenericRequire information
org.eclipse.osgi/resolver/generics = false

#### Profile settings
org.eclipse.osgi/profile/startup = false
org.eclipse.osgi/profile/benchmark = false
org.eclipse.osgi/profile/debug = false

# Override the default implemenation 
org.eclipse.osgi/profile/impl = org.eclipse.osgi.internal.profile.DefaultProfileLogger

# Append all profile messages to the filename specified
org.eclipse.osgi/defaultprofile/logfilename = 

# Output all profile log messages synchronously to the jvm console.
# By default, all log messages are cached until the log buffer is
# requested.
org.eclipse.osgi/defaultprofile/logsynchronously = false

# Specify the size of the default profile implementation log buffer.
org.eclipse.osgi/defaultprofile/buffersize = 256

#### Monitoring settings
# monitor class loading
org.eclipse.osgi/monitor/classes=false

# monitor bundle activation
org.eclipse.osgi/monitor/activation=false

# monitor resource bundle (*.properties) loading
org.eclipse.osgi/monitor/resources=false


#### Trace settings
# trace class loading - snapshot the execution stack when a class is loaded
org.eclipse.osgi/trace/classLoading=false

# trace location - file in which execution traces are written
org.eclipse.osgi/trace/filename=runtime.traces

# trace filters - Java properties file defining which classes should 
# be traced (if trace/classLoading is true)
# File format:
# plugins=<comma separated list of plugins whose classes to trace>
# packages=<comma separated list of package prefixes of classes to trace>
# Note that there may be many 'plugins' and 'packages' lines in one file.
org.eclipse.osgi/trace/filters=trace.properties

# trace bundle activation - snapshot the execution stack when a bundle is activated
org.eclipse.osgi/trace/activation=false

Wednesday, January 25, 2017

Adding filter to tree viewer



PatternFilter filter = new PatternFilter();
FilteredTree tree = new FilteredTree(sash, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true);
TreeViewer viewer = tree.getViewer();

//go on..

Tuesday, January 10, 2017

Removing unwanted preference pages from eclipse


To remove unwanted preferences from your eclipse rcp app, we can do the following.


As part of your App MyRCPWorkbenchAdvisor#postStartup() method, you need to invoke the following code with the preference page id.


private void removeUnwantedPreferences()
{
PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
IPreferenceNode root = getRoot(pm);
if (root != null)
{
removePrefsPage(root"com.windows.preference.mypage.id"); 
}
}


//Identify preference node
private IPreferenceNode getRoot(PreferenceManager pm)
{
try
{
Method m = PreferenceManager.class.getDeclaredMethod("getRoot", (Class[]) null); 
m.setAccessible(true);
return (IPreferenceNode) m.invoke(pm);
}
catch (Exception e)
{
IdeLog.logWarning(TitaniumCorePlugin.getDefault(), e);
}
return null;
}


//remove preference id from the preference node
private void removePrefsPage(IPreferenceNode root, String id)
{
for (IPreferenceNode node : root.getSubNodes())
{
if (node.getId().equals(id))
{
root.remove(node);
}
else
{
removePrefsPage(node, id);
}
}

}



This seems to be work without any issues.

However, I could see other direct approach but that doesn't seem to work well in all scenarios.

PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
pm.remove("com.windows.preference.mypage.id");


Thursday, September 1, 2016

How to set default language for eclipse or for your RCP product

Before you launch an eclipse, configure  -Duser.language=en property in eclipse.ini file.

In the context of mac os.

Example:
  1. Go to /Applications/Eclipse/eclipse.app/Contents/MacOS/
  2. Open eclispe.ini file
  3. Append -Duser.language=en to the end of the file
  4. Restart eclipse


In windows, you can find eclipse.ini file in the eclipse root directory.

Tuesday, May 31, 2016

Eclipse RCP remote debugging

You have two Eclipse applications here

1. Target eclipse  - which you've shipped to client
2. Source eclipse -  source code application


Step 1: Launch target eclipse in debug mode

Note: Here AppceleratorStudio is my Eclipse-based product

Go to your eclipse:
$cd /Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/MacOS

Then run the following command.

$./AppceleratorStudio -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8989

8989 is the port number where you're remote eclipse debug service is running on.

The moment you run the above command, you will get to see "Listening for transport dt_socket at address: 8989" mesasge on the console.



Step# 2: Launch your source eclipse.

  1. Select a project from the project explorer
  2. From toolbar debug menu, go to "Debug configurations..."
  3. Go to 'Remote Java Application'
  4. Right-click 'New'
  5. And provide the configuration something like below.
  6. Click on 'Apply' and 'Debug'