Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to manage 2 input files with Java?
icon5.gif  How to manage 2 input files with Java? [message #688240] Fri, 24 June 2011 08:44 Go to next message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
Hello!
I would like to know how I can get and manage 2 files selected (in the same time) in the package explorer. With only one, my code is :

	private ISelectionListener listener = new ISelectionListener() {
		public void selectionChanged(IWorkbenchPart sourcepart,
				ISelection selection) {
			// We ignore our own selections
			if (sourcepart != ModelView.this) {
				showSelection(sourcepart, selection);
			}
		}
	};


and the method "showSelection" define actions I want to do with the file selected.

But what about 2 input files?


Thanks!!
(no subject) [message #688408 is a reply to message #688240] Fri, 24 June 2011 16:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Renaud,

It's probably an instance of IStructuredSelection, right?


Renaud C wrote:
> Hello!
> I would like to know how I can get and manage 2 files selected (in the
> same time) in the package explorer. With only one, my code is :
>
> private ISelectionListener listener = new ISelectionListener() {
> public void selectionChanged(IWorkbenchPart sourcepart,
> ISelection selection) {
> // We ignore our own selections
> if (sourcepart != ModelView.this) {
> showSelection(sourcepart, selection);
> }
> }
> };
>
> and the method "showSelection" define actions I want to do with the
> file selected.
>
> But what about 2 input files?
>
>
> Thanks!!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: (no subject) [message #688663 is a reply to message #688408] Sat, 25 June 2011 08:40 Go to previous message
Renaud C is currently offline Renaud CFriend
Messages: 19
Registered: May 2011
Junior Member
Ok, actually, I get an Object[] of selected items, so I just get the two first elements of this array, and I have my two input files.

Thanks!
Previous Topic:(no subject)
Next Topic:F3 and other shortcuts stopped working
Goto Forum:
  


Current Time: Fri Apr 19 14:01:11 GMT 2024

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

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

Back to the top