Skip to main content



      Home
Home » Newcomers » Newcomers » Automatic logout function in eclipse(Automatic logout function in eclipse ?)
Automatic logout function in eclipse [message #759106] Sat, 26 November 2011 08:15 Go to next message
Eclipse UserFriend
Hey there.

So im making a little program in eclipse. But i want the user to be automatically logged out if he's idle for xxx min. Any help on what code i need ? and where i need to implement it (main class?).

Thx for any help Wink
Re: Automatic logout function in eclipse [message #759219 is a reply to message #759106] Sun, 27 November 2011 14:05 Go to previous message
Eclipse UserFriend
Hi

The equivalent to the main class in a RCP application is the class
implementing IApplication. But I assume you don't need to do anything
in here.

The tricky part seems to be the part that detects inacativity. It
depends a bit on how exactly the detection and the logout should
happen (is moving the mouse an activity? or only when the user runs
some command in the application? Should the logout occur automatically
after x minutes? or is it enough if the logout ocurs when he attempts
to do something after some time? ...).

Anyhow, if I were you, I'd look at the Jobs API [1]. It lets you create
a job that is run at a configurable frequency.

Closing the application [2]: Platform.getWorkbench().close;

[1] http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html
[2]
http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IWorkbench.html

HTH
Michael
Previous Topic:How to setup new template
Next Topic:Which version of WindowBuilder Pro to use ??
Goto Forum:
  


Current Time: Wed Jul 16 18:11:43 EDT 2025

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

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

Back to the top