Intention Actions  

 

����


�ڵ带 ���� ���� ��� ���� �Ǽ��� �մϴ�.  ï¿½ï¿½Îºï¿½ï¿½ï¿½ IDE�� �ܼ��� �� ����� �����ϰ� ��� �ڽ��� ������ �ϵ��� �������Ӵϴ�. ����� �� ���� �ᱹ �߰��� ��, ����� �߸��� ���� �߰��ϱ� ���ؼ� �������ؾ߸� �ϰ� �׶� ����� ������ �ߴ°�, ��� �ߴ°�, ��� ��ġ�°��� �����ϱ� ���� ����� ������ �ؾ� �մϴ�.

 

����� ���� ���� �з� �Ͽ��� ������ �ַ���� �ڵ�ȭ�ϰ� ���� �� �ݸ鿡 IDEA�� �Ǽ��� �Ͼ ���̶�� ���� �����մϴ�.

�׷��� � ������ ��ſ� ���� �װ͵��� ó���ϴ� ���� �����ϱ� ���ؼ� ����Ǿ� �ְ� ����� ����ų� INTENDED �ϴ� ���� �����Ϸ��� �մϴ�. �� ���� ���α׷��� ��Ʈ�ʿ� �����ϰ�, �׵��� �߻��ϴ� �Ϳ� ���� IDEA ï¿½ï¿½ ����� ���� �ڵ带 �����ϰ�, �׵��� ������ ������ �÷��� �Ϸ��� �մϴ�.  ï¿½Ô´Ù°ï¿½, �װ��� ������ �ذ��ϴ� �ϳ� �̻��� �޼ҵ带 �����մϴ�.  ï¿½ï¿½ï¿½ï¿½ ����� ���ȵ� �ַ�ǿ� �����ϸ�, IDEA�� ���� Å° ��Ʈ��ũ �Ǵ� Ŭ�� �� ������ �ذ��մϴ�.  ï¿½ï¿½ï¿½ï¿½ ���ȵ� �ذ��� ����� �ʿ�� �ϴ� ���� �ƴϸ�, ����� �ּ��� ������ ���� �� �˰� �ְ�, �װ��� ��� �ڽ��� ������ �� �ֽ��ϴ�.  ï¿½Ù²Ù¾ï¿½ ���ϸ�, IDEA�� ����� �ڵ忡�� Ʋ�� �����ΰ� �ִ� ��� ������ ��, �װ��� �װ��� �ذ��� ACTION�� �����մϴ�.  ï¿½ï¿½ Ư¡�� Intention Actions�̶�� �Ҹ��ϴ�. �װ��� �Ǽ��� �߰��ϰ� �ذ��� �Ӹ� �ƴ϶� ������� �Ͽ��� �װ͵��� ����DZ� ���� ���ο� ���� ����Ͽ� ���������ν�  �ڵ��� ������ �� �� �ֽ��ϴ��̰��� ����� ��� ���� �� �ִ� �� �� ���� ���ڽ��ϴ�.


���� �ڵ带 ���� �����̶��, ����� ���ο� �ʵ尡  ï¿½Ê¿ï¿½ï¿½Ï´Ù´ï¿½ ���� �߰��մϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½, ����� Ŭ���� ������ ��ũ�� �� �� ���̰� ���ο� �ʵ带 �����ϰ� �Ʒ��� ��ũ�� �� �ϰ� �װ��� ����ϱ� �����մϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ ���ο� ��ȣ�� �� �ݴ��� ���� �Ǵ� ����� �ܰ谡 ��������� �𸣰�, ��ű��� ����� ������ ������ ���ϸ鼭 �װ��� �����ϴ� ���� �ؾ� �����ϴ�.  ï¿½î¶² ��쿡, �װ��� ��ȿ�����Դϴ�.  IDEA  �� �Բ� ï¿½ï¿½ï¿½ï¿½ï¿½ ���� ù ��°�� �װ��� �����ϸ鼭 ���ο� �ʵ带 ����ϴ� ���� ������ �� �ֽ��ϴ�.  ï¿½×°ï¿½ï¿½ï¿½ ���� ������� �ʱ� ������ �̸���  highlighted as an error �� �� �Դϴ����� ij���� �̸����� �ű�ʽÿ�.


IDEA�� ������ ���ο� �鿭 ���� ��ȣ�� ǥ���� ���Դϴ�.  Intention Action Ư¡�� ������ �� ��� ����� ���� �����ϴ� �װ��� ��ſ��� ��ȣ�� �� �Դϴ�.


���� Alt + Enter (�Ǵ� �鿭 ������ Ŭ���߽��ϴ�)�� �����ʽÿ�. �׷��� IDEA�� �װ��� �� ������ �Բ� �ڵ带 �Ƚ��ϱ� ���� ������ �� �ִ� ���ȵ� ������ ����� �˾� �մϴ�.


�� ���, IDEA�� ������ �� ���� ������ �����մϴ�:  ï¿½Êµï¿½, ���� ���� �Ǵ� �� ������ �����Ͻʽÿ�. �׷��� ������ ������ �̸��� �ٲٽʽÿ�.  ï¿½ï¿½ï¿½ï¿½ ���ȵ� �ַ���� �����ϸ�(�� ���, �ʵ带 �����ϸ鼭), Enter (�Ǵ� �˾����� �׸��� Ŭ��)�� �����ʽÿ�.
IDEA�� �� ���� ������ ���ο� ���ο� �ʵ� ������ ������ ���Դϴ�(����� �װͿ� ��ũ�� �� �ʿ�� �����ϴ�), ���� �� Ÿ���� �����Ϸ��� �õ��� �� �Դϴ�.  ï¿½ï¿½ï¿½ï¿½ ������ ��� �͵� ����� ������ ������ ���ϴ��� �ݿ����� ������, �˾��� �����ϱ� ���� Escape�� �����ʽÿ�. ����� �����ϵ��� ����� �� ���� �ڵ带 �Ƚ��ϴ� ���� ����� �� �ֽ��ϴ�.


���� ���� ��� �Ǵ� �Ӽ��� ���� GUI �����̳����� ������ �����μ� Intention Action�� ��Ÿ���ϴ�.


 

Intention Action�� �Ұ����ϰ� �ϴ� ��


���� ����� ����ġ Off�� �� �ִ� �װ� ���� ij���� ���� ������ Ư���� ǥ�� �� �Ǵ� ������Ʈ��Ʈ�� ���� ������Ʈ���� ��Ÿ���� intention action�� �ʿ����� ��������� ���ȵ� Intention Action�� �������� ���� ��ȣ�� �����ϴ�.  ï¿½Ù·ï¿½ �װ��� Ŭ���Ͻʽÿ�. ���� ��ȣ�� ȸ������ �� ���Դϴ�. �׸��� �� ������ �ٽô� ��Ÿ���� ���� ���Դϴ�.  ï¿½×·ï¿½ï¿½ï¿½, ���� ������ �� ���� ������ ������ ����� �׵� ����� ����ġ�� ���߸� �մϴ�.

�׸��� ���� ����� � Intention Action�� �� ǥ�����̳� ������Ʈ��Ʈ�� �̿��� �� �ִ��� �˰� ������ Alt + Enter ï¿½ï¿½ï¿½ï¿½ �� ����� �� �ֽ��ϴ�.  ï¿½Ò°ï¿½ï¿½ï¿½ï¿½ï¿½Intention Action�� ����ġ �ϱ� ���� ȸ������ �� ������ Ŭ���Ͻʽÿ�.

Intention Action�� Ÿ��


�Ϲ�������, Intention Action�� �� ���� �׷����� ������ �� �ֽ��ϴ�:

1.  "Create from usage" intentions 

�� Ÿ���� Intention Action�� ���ο� �ڵ� �׸��� �����մϴ�:  Å¬ï¿½ï¿½ï¿½ï¿½, �������̽�, �޼ҵ� �� ï¿½×µï¿½ï¿½ï¿½ ����� �ڵ带 ��� ��ŭ ����� ����Ʈ�ϰ�, Ư���� ��쿡 �´� ������ �����մϴ�.  ï¿½ï¿½ï¿½ï¿½ ���, ���� ������ �빮���̰ų� Create class�� �̸��� new Å°ï¿½ï¿½ï¿½ï¿½ ���� Ÿ���� �� ��, �Ǵ� �빮�ڷ� ������ �ĺ��ڰ� ���۵Ǵ� ���� Create Constant Field�� ���ȵ˴ϴ�.

�� Ÿ�� ���� �ֿ��� ������ ����� ���ο� ���� ù ��°�� �׵��� �������� �ʰ� ����ϱ� ������ �� �ִٴ� ���Դϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ ����� ��� �����ϰ� �ִ� ���� IDEA�� �����ϴ� ����, ���ο� ���� ���� �����ϴ� ��ó�� ����� �󼼿� ���� ����� ������ �½�ũ���� ������ �ʽ��ϴ�.

2.  Quick fixes 

 
�� Ÿ���� Intention Action�� ������ �ڵ� �Ǽ��� �����մϴ�: �������� ���� ������ ��� �Ǵ� �߸��� Ÿ���� ǥ�� ���� ����ϸ鼭 ö�ڸ� Ʋ���� �� ������.

IDEA �� ����� Ÿ���� �ϴ� �����μ� �� ������ �������� ��� ������ ���� ������ ���Ȱ� �Բ� Intention Action�� ����ϰ� �ִ� �װ͵��� �Ƚ��ϴ� ���� ����� �����մϴ�.

3.  Micro-refactorings 

 
�̷� intention actions �� �ڵ忡 ���� ��Ÿ������, �װ��� �Ƹ��� �Ʒ��� ���� �Ϳ� ���� ���� ���� ������ ���� �� ���� ������ �𸨴ϴ�.

  ����� �Ҵ��� ����
  if 
������ ��ȯ
  2
���� if ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Æ®ï¿½ï¿½Æ®ï¿½ï¿½ï¿½ï¿½ ����
 
��Ÿ

4.  EJB-specific intentions  

�� Ÿ���� Intention Action�� EJB Ŭ���� ������ ���� �߻��մϴ�.  ï¿½×µï¿½ï¿½ï¿½ ���� ������ ��� ������ ��Ƴ��� �ذ��� �����մϴ�.  ï¿½ï¿½ï¿½ï¿½ ����, Intention Action List: Intention Actions for EJBs�� ���ʽÿ�.

5.  Miscellaneous intentions  
  

�׷��� �׷��� �ƹ��Ϳ��� ���� ���� �� ���� �ǵ��� �����մϴ�. ����, �׵� ���� 2���� �ֽ��ϴ�:
Fetch external resource
�� Ignore external resource
 

�鿭 ���� ��ȣ�� ���� ���� �ǵ��� ���� �ٸ��ϴ�.

Intention action sign 
 

��� ������ IDEA�� ����� �ڵ带 �ٲٱ� ���� �����ϴ� ���� ǥ���մϴ�. �װ��� ï¿½Úµï¿½ ����(����ũ�� �����丵�� ����)�� ���� ������ ���Ͽ� ��� �������� ��Ȳ�� ������ Ŀ���մϴ�.

Quick-fix sign  

����ǥ�� �ִ� ���� ������ IDEA�� �޼ҵ�� ��ſ��� ���� �Ƚ��� �����ϴ� ���� ǥ���մϴ�. �װ��� Create from usage intentions�� Quick fixes�μ� �׷��� ��� �ǵ��� ���谡 �ֽ��ϴ�.


Intention Actions�� ������ ����� ���� ����,  Intention Action List  ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ �����Ͻʽÿ�

'Create from Usage' Intention Actions  


�̰��� '���������� Ŭ���� ����', '���������� �ʵ� ����' ���� �����Ͽ� �ϴ��� Intention Action�� ���� ���� ��Ī�Դϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ ���ذ� ������ ���� �� �� �ǵ��� ���� ������ ������� �۵��մϴ�.

���� ���, ����� ������ ���� ���ذ� ������ �����ϴ�:

 

Alt + Enter�� ������ Create Field 'ref_1'�� �����մϴ�

 

IDEA�� �ʵ带 �����ϰ� ���-�ٿ� ��Ͽ��� ������ Ÿ���� �����մϴ�.


����� IDEA�� ���� ���� �Ǵ� �ٸ� ���� �Է��Ͽ� ���ȵ� Ÿ�� ���� 1���� ������ �� �ֽ��ϴ�.

'Create Getter/Setter' Intention Action  


�̰��� '���������� ����' Intention Action ï¿½ï¿½ Ư���� ����Դϴ�.
���ذ��� �޼ҵ� ���� get, set ï¿½Ç´ï¿½ is   �ܾ �����ؾ߸� �մϴ�.


Alt + Enter�� �����ʽÿ�.  IDEA�� �����ϴ� ������ ���� ����(�Ǵ� ������ �ĺ� ��ȣ�� �ִ� ���� �����ϴ� ����)�� �����ϴ� ���� �����ϰ� Create Getter�� �����մϴ�.


IDEA
�� ���ȵ� ���� ���¿� �Բ� ���� �޼ҵ带 �����մϴ�. �װ��� �ڵ������� ���õ˴ϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ ���ο� ���� Ÿ������ �� �ְų� Ctrl + Space�� ������ ��ϰ� �ٸ� Ÿ���� ������ �� �ֽ��ϴ�.

�޼ҵ忡 ���� ���� ���¸� �����ϰ� �� �Ŀ�(Enter�� �����ϴ�), ����� ����� ���� ������ Ÿ���� �ʵ忡�� ������ �Ǵ� ���ϵ� ������ �̸��� �����ϴ� ���� �����ϰ� �ϸ� �˾��մϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ IDEA �Ǵ� �� �ٸ� ���� �Է��Ͽ� ���ȵ� Ÿ�� ���� �� ���� ������ �� �ֽ��ϴ�.  ï¿½Ô´Ù°ï¿½, ����� ���� �ʵ忡 ���� �ⱸ�� ���ʷ� �� �� �ְų�, ���ο� �ϳ��� ������ �� �ֽ��ϴ�.

'Rename Reference' Intention Action   


Rename Reference Intention Action ��  Create from Usage Ÿ���� intentions�� ���� �۵��մϴ�.
���� ����� �̸��� �߸� Ÿ���� �� �� �ֽ��ϴ�. �װ��� �Ƚ��ϴ� ���� �����Rename Reference intention action�� �Բ� �ֽ��ϴ�:

����� ������ �� Rename Reference �� �׼� �׸��� �����ϰ�, IDEA�� ������ ���縵�� �Բ� ���� ���̿��� ������ ����ϴ�.

�׸��� ��ȿ�� �ʵ�� ���� ���� �̸��� �׸��� ��� �ٿ��մϴ�.


����� Enter ������ ����Ʈ ����(�����ϰ� ���������� �����)�� ������ �� �ְų�, �Ǵ� ����� �ٸ� �̸�(�̸��� ª���� ���� ����)�� Ÿ���� �� �� �ֽ��ϴ�, �Ǵ� ����� drop-down ���(�� �̸��� ���� ���� �̵��)���� IDEA�� ���� ���ȵ� �̸� ���� 1���� ������ �� �ֽ��ϴ�.  Ã¹ï¿½ï¿½Â° ������ ���ڸ� Ÿ�����Ͽ� ����� ����� ���� �� �ֽ��ϴ�.  ï¿½ï¿½ï¿½ï¿½ï¿½ Enter�� ������ �� �Ŀ� ï¿½ï¿½ï¿½ï¿½ �̸��� �ִ� ��� ���ذ� ������ ���ο� ������ �̸��� �ٲ����ϴ�.

'Add Javadoc Tag' Intention Action  


Add Javadoc Tag intention action��  Create from Usage Å¸ï¿½ï¿½ï¿½ï¿½ intentionsó�� �۵��մϴ�

 
���� ����� ���ο� �ֹ��� Javadoc �±׸� ����, Intention Action�� �װ��� �ֹ��� Javadoc �±��� ��Ͽ� �߰��ϴ� ���� �����ϰ� �ϴ� ���� ���ȵ˴ϴ�:


����� File | Settings | IDE Settings: Errors: Unknown Javadoc Tags: Options���� �ֹ��� Javadoc �±׸� ������ �� �ֽ��ϴ�.

 


Interface Intention Action on Parameter Mismatch 


�� Intention Action�� ����ũ�� �����丵�� ���谡 �ֽ��ϴ�.  ï¿½Ïºï¿½ �� ������ ������ �� �������̽��� ������ �޼ҵ� ���� ���� ��쿡 �װ��� Ŭ������ �������̽� ������ �����մϴ�.

 
���� 2���� Ŭ������ �������̽��� �����ʽÿ�.



ClassCaller �� bar()  ï¿½Þ¼Òµï¿½ï¿½ ClassCallee ��� foo()  ï¿½ï¿½ �θ��ϴ��׷���, �ݷ� Ŭ������ myInterface  �������̽��� ������ �����մϴ�.  Alt + Enter�� �����ʽÿ�.



'
 Make 'ClassCaller' implement Sample.I  '�� �����Ͻʽÿ�.
 


�������̽� ������ Ŭ���� ���� �߰��˴ϴ�.  ï¿½ï¿½ï¿½ï¿½ �������̽� �޼ҵ�� Select Methods to Implement ï¿½ï¿½ï¿½Ì¾ï¿½Î±×¿ï¿½ �Բ� ������ ���� ���ȵ� ���Դϴ�.

Static Import Intention Actions  


������ ����Ʈ�� ������� �Ͽ��� ������ Ŭ������ Ŭ���� ����� ���ľ� ���� ����ϰ� �մϴ�. ������ �� ���� ������ ����Ʈ intentions �� �ֽ��ϴ�, "on demand" �� "single static import". 

���� ij���� �����Ϳ� Ŭ���� �̸� ���� ������ , On-demand static import�� �Ҹ������ϴ�.


Then all members of the imported class will be used without a qualifier. The
 import  statement will look as follows: 

�� ���� ����Ʈ�� Ŭ������ ��� ���� ��Ҵ� ���ľ� ���� ���� ���Դϴ�.  import ������Ʈ��Ʈ�� ������ ���� �� ���Դϴ�:

import static java.lang.Math.abs;

���� ij���� �����Ϳ� Ŭ���� �̸� ���� ������ �ϳ��� ������ ����Ʈ�� �Ҹ������ϴ�.



����Ʈ�� Ŭ������ �־��� �̸��� �ִ� ���� ��Ҵ� ���ľ� ���� ���� ���Դϴ�.  import  ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Æ®ï¿½ï¿½Æ®ï¿½ï¿½ ������ ���� �� ���Դϴ�:

import static java.lang.Math.abs;


�� intentions�� ����ϱ� ����,  ï¿½Ú¹ï¿½ SDK 1.5�� ���� ��� ���� ï¿½ï¿½ ��� �����ϰ� �ϰ� �Ǿ�߸� �մϴ�.


 

Import Assistant 


����� Import Assistant Ư¡�� Intention Action���μ� �ൿ�ϱ� ���� ������ �� �ֽ��ϴ�.  ï¿½ï¿½ï¿½ï¿½ ���� Managing Imports: Import Assistant ï¿½ï¿½ ���ʽÿ�.