-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00b0294
commit 0929c80
Showing
4 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin version="2"> | ||
<id>makasprzak.step-builder-generator</id> | ||
<name>Step Builder Pattern generator</name> | ||
<version>1.0</version> | ||
<version>1.1</version> | ||
<vendor email="[email protected]" url="https://github.com/makasprzak">Maciej Kasprzak</vendor> | ||
|
||
<description><![CDATA[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
src/makasprzak/idea/plugins/dialog/PropertyCellRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
package makasprzak.idea.plugins.dialog; | ||
|
||
import com.intellij.ide.util.DefaultPsiElementCellRenderer; | ||
import com.intellij.psi.PsiElement; | ||
import makasprzak.idea.plugins.model.PsiPropertyContainer; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class PropertyCellRenderer implements ListCellRenderer<PsiPropertyContainer> { | ||
public class PropertyCellRenderer implements ListCellRenderer { | ||
private final DefaultPsiElementCellRenderer renderer = new DefaultPsiElementCellRenderer(); | ||
|
||
@Override | ||
public Component getListCellRendererComponent(JList<? extends PsiPropertyContainer> list, | ||
PsiPropertyContainer value, | ||
public Component getListCellRendererComponent(JList list, | ||
Object value, | ||
int index, | ||
boolean isSelected, | ||
boolean cellHasFocus) { | ||
return renderer.getListCellRendererComponent(list,value.getPsiElement(),index,isSelected,cellHasFocus); | ||
return renderer.getListCellRendererComponent(list, getValue(value),index,isSelected,cellHasFocus); | ||
} | ||
|
||
private PsiElement getValue(Object value) { | ||
return ((PsiPropertyContainer)value).getPsiElement(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters