Selector plugin - adds rectangular selection to IDEA

http://www.intellij.org/twiki/bin/view/Main/SelectorPlugin

This plugin adds rectangular selection capabilities to IDEA. It's still a
young plugin. I plan on enhancing it a lot in the near future. But, I
thought I'd get it out there now.

Currently, IDEA doesn't support multiple selections, so I had to use the
highlighting feature. Thus, you need to use the alternate versions of
Cut/Copy/Paste that are provided by this plugin. They completely replace
IDEA's Cut/Copy/Paste. I think I've correctly implemented all the
functionality.

To start a rectangular selection, click with the ALT key down (or SHIFT-ALT)
and drag. Currently, everything (color, key combo, etc.) is hard coded, but
I'll be adding a prefs panel soon.

--
Jordan Zimmerman
Altura International
Catalog City



19 comments
Comment actions Permalink

I've added discontinuous selection support.

FYI

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

Hi,

I'm definitely going to use this plugin I was about to make an feature
request.'
BUT the I can only get the rectangular selection to work. Not the copying
and pasting.

I have tried both ctrl+c, the icon, and from the menu without luck.

Keep up the good work.

idea 657.

Regards
Anders Nielsen

"Jordan Zimmerman" <jordanz@altura.com> skrev i en meddelelse
news:ao3aoc$sa7$1@is.intellij.net...

I've added discontinuous selection support.

>

FYI

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>


0
Comment actions Permalink

I've released a new version that fixes CTRL-click.

Copying should work. Are you selecting "Selector Copy"? The plugin does not
remap the IDEA's built in cut/copy/paste. You have to do that yourself. Or,
just use the menu commands: Selector Copy, Selector Cut, Selector Paste.
They are on the Edit Menu and the right-click Popup Menu.

Also, I've only tried this on Win2K.

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

I think that pasting should work like in Visual Studio, i.e. not add rows if
not at the end of the file.
Example:
12
12
12
If I mark the column of 3 '1' characters, then put the cursor after the top
'2' and paste, I should get
121
121
121
and not
121
1
1
12
12
Amnon
"Jordan Zimmerman" <jordanz@altura.com> wrote in message
news:ao2equ$241$1@is.intellij.net...

http://www.intellij.org/twiki/bin/view/Main/SelectorPlugin

>

This plugin adds rectangular selection capabilities to IDEA. It's still a
young plugin. I plan on enhancing it a lot in the near future. But, I
thought I'd get it out there now.

>

Currently, IDEA doesn't support multiple selections, so I had to use the
highlighting feature. Thus, you need to use the alternate versions of
Cut/Copy/Paste that are provided by this plugin. They completely replace
IDEA's Cut/Copy/Paste. I think I've correctly implemented all the
functionality.

>

To start a rectangular selection, click with the ALT key down (or

SHIFT-ALT)

and drag. Currently, everything (color, key combo, etc.) is hard coded,

but

I'll be adding a prefs panel soon.

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>
>


0
Comment actions Permalink

OK - I just tried it in VC and I see what you mean. I'll work on that
(eventually, I guess it can be an option).

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

Also, I guess that it would be problematic to support drag and drop, but...

I guess that your plugin would be much easier to write if IntelliJ would
support non contiguous selections...

Amnon

"Jordan Zimmerman" <jordanz@altura.com> wrote in message
news:ao4smj$nae$1@is.intellij.net...

OK - I just tried it in VC and I see what you mean. I'll work on that
(eventually, I guess it can be an option).

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>


0
Comment actions Permalink

I've uploaded version 1.3 that adds a new command, Selector Paste Special.
This pastes rectangular selections without adding new lines ala Word and
Visual Studio. I'm pretty sure I got it right, but please verify for me.

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

Hi,

I can only say.... DUH.

My mistake. Had'nt seen the new menu items :)

So now I REALLY like your plugin. :)

regards

Anders Nielsen


"Jordan Zimmerman" <jordanz@altura.com> skrev i en meddelelse
news:ao4akl$1q0$1@is.intellij.net...

I've released a new version that fixes CTRL-click.

>

Copying should work. Are you selecting "Selector Copy"? The plugin does

not

remap the IDEA's built in cut/copy/paste. You have to do that yourself.

Or,

just use the menu commands: Selector Copy, Selector Cut, Selector Paste.
They are on the Edit Menu and the right-click Popup Menu.

>

Also, I've only tried this on Win2K.

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>


0
Comment actions Permalink

Yup, it works as expected.

Cool stuff...
One thing, though. Try to mark stuff and copy with your plugin and then
press CtrlShiftV (choosing the sniplet to paste). IntelliJ has an error
(657). If it doesn't happen on your machine I'll try to investigate some
more.

Amnon

"Jordan Zimmerman" <jordanz@altura.com> wrote in message
news:ao50nb$r8v$1@is.intellij.net...

I've uploaded version 1.3 that adds a new command, Selector Paste

Special.

This pastes rectangular selections without adding new lines ala Word and
Visual Studio. I'm pretty sure I got it right, but please verify for me.

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>


0
Comment actions Permalink

It is possible (and pretty easy) to replace the IDEA cut/copy/paste
with your own. But you need to do it with every action group that has
the actions.

Jordan Zimmerman wrote:

http://www.intellij.org/twiki/bin/view/Main/SelectorPlugin

This plugin adds rectangular selection capabilities to IDEA. It's still a
young plugin. I plan on enhancing it a lot in the near future. But, I
thought I'd get it out there now.

Currently, IDEA doesn't support multiple selections, so I had to use the
highlighting feature. Thus, you need to use the alternate versions of
Cut/Copy/Paste that are provided by this plugin. They completely replace
IDEA's Cut/Copy/Paste. I think I've correctly implemented all the
functionality.

To start a rectangular selection, click with the ALT key down (or SHIFT-ALT)
and drag. Currently, everything (color, key combo, etc.) is hard coded, but
I'll be adding a prefs panel soon.

--
Jordan Zimmerman
Altura International
Catalog City




--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0
Comment actions Permalink

One thing, though. Try to mark stuff and copy with your plugin and then
press CtrlShiftV (choosing the sniplet to paste). IntelliJ has an error
(657). If it doesn't happen on your machine I'll try to investigate some
more.


There is a new version (1.4) that fixes this problem. I was putting text on
the clipboard with the wrong line endings.

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

Cool.

Just a question: Can you override automatically (i.e. replace) the Cut,
Copy, Paste, etc. of the IJ Edit menu? That way it would be totally
integrated.

Great stuff! I like it a lot! IntelliJ should implement all of that
internally (to enable drag and drop, etc.)

Amnon
"Erb" <dont@evenbother.com> wrote in message
news:ao6p4t$bhn$1@is.intellij.net...

It is possible (and pretty easy) to replace the IDEA cut/copy/paste
with your own. But you need to do it with every action group that has
the actions.

>

Jordan Zimmerman wrote:

http://www.intellij.org/twiki/bin/view/Main/SelectorPlugin

>

This plugin adds rectangular selection capabilities to IDEA. It's still

a

young plugin. I plan on enhancing it a lot in the near future. But, I
thought I'd get it out there now.

>

Currently, IDEA doesn't support multiple selections, so I had to use the
highlighting feature. Thus, you need to use the alternate versions of
Cut/Copy/Paste that are provided by this plugin. They completely replace
IDEA's Cut/Copy/Paste. I think I've correctly implemented all the
functionality.

>

To start a rectangular selection, click with the ALT key down (or

SHIFT-ALT)

and drag. Currently, everything (color, key combo, etc.) is hard coded,

but

I'll be adding a prefs panel soon.

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>
>

>
>

--

>

Erb

>

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

>


0
Comment actions Permalink

Can you override automatically (i.e. replace) the Cut,
Copy, Paste, etc. of the IJ Edit menu? That way it would be totally
integrated.


If I can figure it out! If anyone knows how, let me know.

IntelliJ should implement all of that
internally (to enable drag and drop, etc.)


I imagine they will eventually.

--
Jordan Zimmerman
Altura International
Catalog City


0
Comment actions Permalink

great addition to the Editor !
I always wondered why that feature wasn't there in the first place...


"Jordan Zimmerman" <jordanz@altura.com> schrieb im Newsbeitrag
news:ao2equ$241$1@is.intellij.net...

http://www.intellij.org/twiki/bin/view/Main/SelectorPlugin

>

This plugin adds rectangular selection capabilities to IDEA. It's still a
young plugin. I plan on enhancing it a lot in the near future. But, I
thought I'd get it out there now.

>

Currently, IDEA doesn't support multiple selections, so I had to use the
highlighting feature. Thus, you need to use the alternate versions of
Cut/Copy/Paste that are provided by this plugin. They completely replace
IDEA's Cut/Copy/Paste. I think I've correctly implemented all the
functionality.

>

To start a rectangular selection, click with the ALT key down (or

SHIFT-ALT)

and drag. Currently, everything (color, key combo, etc.) is hard coded,

but

I'll be adding a prefs panel soon.

>

--
Jordan Zimmerman
Altura International
Catalog City

>
>
>


0
Comment actions Permalink

Amnon I. Govrin wrote:


Just a question: Can you override automatically (i.e. replace) the Cut,
Copy, Paste, etc. of the IJ Edit menu? That way it would be totally
integrated.


I think even if you specified an alternative class for these actions in
the plugin.xml, the built-in ones would override it. And in any case, you would
have to specify this for each menu and action place the action occurs in. And there
is no automatic way to do it programmatically. Registering an action ID is not the same
as installing it in a menu.

--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0
Comment actions Permalink

Jordan,

Looks like these plugin answers your question:

http://www.intellij.org/twiki/bin/view/Main/NoSelectionCopyKiller

--
Best regards,
Mike Aizatsky.
-


JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


0
Comment actions Permalink

Just a curiosity: I never miss the block selection in IDEA. What are you
using it for?

--
Best regards,
Mike Aizatsky.
-


JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


0
Comment actions Permalink

Mike, I don't know about the others but one example from me:
- a class with 9 member variables
- you need to use these variables in constructor (assign), clone, cleanup,
whatever.
- it's much more convenient to copy all the variable names to the method and
then
edit (finish the assignment, call some methods, or just 'soutv' them).

Perhaps if IDEA would have an action to generate all variable names
(one per line), that would be suffucient. Or maybe even better, no need to
have all
declarations together, no need to have them aligned...


r.

"Mike Aizatsky" <mike@intellij.com> wrote in message
news:aoem2g$att$1@is.intellij.net...

Just a curiosity: I never miss the block selection in IDEA. What are you
using it for?

>

--
Best regards,
Mike Aizatsky.
------------------------------
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"

>
>


0
Comment actions Permalink

You can copy the whole variable declaration block and search 'n
replace the "private "/"private final " with "".

Tom


On Mon, 14 Oct 2002 11:25:07 -0400, "Richard Nemec"
<rndzank@attbi.com> wrote:

Mike, I don't know about the others but one example from me:
- a class with 9 member variables
- you need to use these variables in constructor (assign), clone, cleanup,
whatever.
- it's much more convenient to copy all the variable names to the method and
then
edit (finish the assignment, call some methods, or just 'soutv' them).

Perhaps if IDEA would have an action to generate all variable names
(one per line), that would be suffucient. Or maybe even better, no need to
have all
declarations together, no need to have them aligned...


r.

"Mike Aizatsky" <mike@intellij.com> wrote in message
news:aoem2g$att$1@is.intellij.net...

Just a curiosity: I never miss the block selection in IDEA. What are you
using it for?

>

--
Best regards,
Mike Aizatsky.
------------------------------
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"

>
>


0

Please sign in to leave a comment.