Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How do i open previous instance of my RCP application
How do i open previous instance of my RCP application [message #769071] Wed, 21 December 2011 05:48 Go to next message
Eclipse UserFriend
I'm trying to make my RCP application as a single instance run,
for that i tried implementing a socket technique despite of file LOCK technique,and I'm almost done, my application behavior is such that,it can show information message saying that "there is already an instance running" and it exits , despite of this how can i make the previous running instance bring to front(maximize).
Re: How do i open previous instance of my RCP application [message #769255 is a reply to message #769071] Wed, 21 December 2011 11:55 Go to previous message
Eclipse UserFriend
You want to use org.eclipse.osgi.service.datalocation.Location.lock(), it's what we do in the SDK. You can get the instance location from your Activator using something like:

public Location getInstanceLocation() {
    if (locationTracker == null) {
        Filter filter = null;
        try {
            filter = context.createFilter(Location.INSTANCE_FILTER);
        } catch (InvalidSyntaxException e) {
            // ignore this. It should never happen as we have tested the
            // above format.
        }
        locationTracker = new ServiceTracker(context, filter, null);
        locationTracker.open();
    }
    return (Location) locationTracker.getService();
}



PW
Previous Topic:Get the absolute path of Eclipse RCP exe ?
Next Topic:Add a propertyPage inside another propertyPage, how?
Goto Forum:
  


Current Time: Wed Jul 23 15:36:52 EDT 2025

Powered by FUDForum. Page generated in 0.03997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top