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 04:44 Go to next message
Renaud C is currently offline Renaud C
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 12:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25916
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!!
Re: (no subject) [message #688663 is a reply to message #688408] Sat, 25 June 2011 04:40 Go to previous message
Renaud C is currently offline Renaud C
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: Wed Jul 23 14:23:46 EDT 2014

Powered by FUDForum. Page generated in 0.02250 seconds