Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 802b9bd

Browse files
committed
changed font and pos of links, simplified code
Signed-off-by: Andre Dietisheim <[email protected]>
1 parent 687b58a commit 802b9bd

File tree

2 files changed

+45
-59
lines changed

2 files changed

+45
-59
lines changed

src/main/java/org/jboss/tools/intellij/openshift/ui/feedback/FeedBackDialog.form

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
</constraints>
2727
<properties/>
2828
</component>
29-
<grid id="6b194" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="5">
29+
<grid id="6b194" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="5">
3030
<margin top="0" left="0" bottom="0" right="0"/>
3131
<constraints>
32-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
32+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
3333
</constraints>
3434
<properties/>
3535
<border type="none"/>
3636
<children>
3737
<component id="5f774" class="javax.swing.JLabel" binding="openshiftPic">
3838
<constraints>
39-
<grid row="0" column="0" row-span="2" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false">
39+
<grid row="0" column="0" row-span="3" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
4040
<minimum-size width="100" height="100"/>
4141
</grid>
4242
</constraints>
@@ -45,65 +45,64 @@
4545
<text value=""/>
4646
</properties>
4747
</component>
48-
<component id="cbdea" class="javax.swing.JLabel" binding="openshiftToolkitText">
48+
<component id="cbdea" class="javax.swing.JLabel" binding="opinionMattersText">
4949
<constraints>
50-
<grid row="0" column="1" row-span="2" col-span="1" vsize-policy="0" hsize-policy="5" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
50+
<grid row="0" column="1" row-span="4" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
5151
</constraints>
5252
<properties>
5353
<horizontalAlignment value="2"/>
5454
<horizontalTextPosition value="10"/>
5555
<text value=""/>
5656
</properties>
5757
</component>
58-
<component id="22f43" class="javax.swing.JLabel" binding="opinionMattersText">
58+
<component id="73cfc" class="javax.swing.JLabel" binding="octoPic">
5959
<constraints>
60-
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
60+
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
61+
<minimum-size width="50" height="50"/>
62+
</grid>
6163
</constraints>
6264
<properties>
65+
<horizontalAlignment value="4"/>
6366
<text value=""/>
6467
</properties>
6568
</component>
66-
<component id="3fd8b" class="javax.swing.JTextPane" binding="marketplaceRate">
69+
<component id="d8fce" class="javax.swing.JLabel" binding="jetBrainsPic">
6770
<constraints>
68-
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
71+
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="2" fill="0" indent="0" use-parent-layout="false">
72+
<minimum-size width="50" height="50"/>
73+
</grid>
6974
</constraints>
7075
<properties>
71-
<contentType value="text/html"/>
72-
<editable value="false"/>
76+
<horizontalAlignment value="4"/>
77+
<text value=""/>
7378
</properties>
7479
</component>
75-
<component id="73cfc" class="javax.swing.JLabel" binding="octoPic">
80+
<component id="f285b" class="javax.swing.JTextPane" binding="gitHubContact">
7681
<constraints>
77-
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false">
78-
<minimum-size width="50" height="50"/>
79-
</grid>
82+
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false"/>
8083
</constraints>
8184
<properties>
82-
<horizontalAlignment value="4"/>
83-
<labelFor value="3627a"/>
84-
<text value=""/>
85+
<contentType value="text/html"/>
86+
<editable value="false"/>
87+
<text value="&lt;html&gt;&#10; &lt;head&gt;&#10; &#10; &lt;/head&gt;&#10; &lt;body&gt;&#10; &lt;/body&gt;&#10;&lt;/html&gt;&#10;"/>
8588
</properties>
8689
</component>
87-
<component id="3627a" class="javax.swing.JTextPane" binding="gitHubContact">
90+
<component id="86f8e" class="javax.swing.JTextPane" binding="marketplaceRate">
8891
<constraints>
89-
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
92+
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false"/>
9093
</constraints>
9194
<properties>
9295
<contentType value="text/html"/>
9396
<editable value="false"/>
9497
<text value="&lt;html&gt;&#10; &lt;head&gt;&#10; &#10; &lt;/head&gt;&#10; &lt;body&gt;&#10; &lt;/body&gt;&#10;&lt;/html&gt;&#10;"/>
9598
</properties>
9699
</component>
97-
<component id="d8fce" class="javax.swing.JLabel" binding="jetBrainsPic">
100+
<component id="e34a6" class="javax.swing.JLabel" binding="openshiftToolkitText">
98101
<constraints>
99-
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false">
100-
<minimum-size width="50" height="50"/>
101-
</grid>
102+
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false"/>
102103
</constraints>
103104
<properties>
104-
<horizontalAlignment value="4"/>
105-
<labelFor value="3fd8b"/>
106-
<text value=""/>
105+
<text value="Label"/>
107106
</properties>
108107
</component>
109108
</children>

src/main/java/org/jboss/tools/intellij/openshift/ui/feedback/FeedBackDialog.java

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.awt.image.BufferedImage;
2828
import java.net.MalformedURLException;
2929
import java.net.URL;
30+
import java.util.Arrays;
3031
import java.util.Objects;
3132
import java.util.regex.Pattern;
3233

@@ -65,7 +66,7 @@ public class FeedBackDialog extends DialogWrapper {
6566
private JLabel openshiftToolkitText;
6667
private JLabel octoPic;
6768
private JLabel opinionMattersText;
68-
private JEditorPane gitHubContact;
69+
private JTextPane gitHubContact;
6970
private JLabel jetBrainsPic;
7071
private JTextPane marketplaceRate;
7172

@@ -76,16 +77,16 @@ public FeedBackDialog() {
7677
setTitle("Share Feedback");
7778

7879
// Top images
79-
openshiftPic.setIcon(createResizedImageIcon(this.getClass().getResource("/images/openshift_extension.png"), 100, 100));
80-
octoPic.setIcon(createResizedImageIcon(this.getClass().getResource("/images/github-mark.png"), 50, 50));
81-
jetBrainsPic.setIcon(createResizedImageIcon("https://resources.jetbrains.com/storage/products/company/brand/logos/jb_square.png", 50, 50));
80+
openshiftPic.setIcon(createResizedImageIcon(this.getClass().getResource("/images/openshift_extension.png"), 60, 60));
81+
octoPic.setIcon(createResizedImageIcon(this.getClass().getResource("/images/github-mark.png"), 20, 20));
82+
jetBrainsPic.setIcon(createResizedImageIcon("https://resources.jetbrains.com/storage/products/company/brand/logos/jb_square.png", 30, 30));
8283

8384
// Top labels
8485
openshiftToolkitText.setText("<html><font color=red size=+1><b>OpenShift</b></font><b> Toolkit</b></html>");
85-
opinionMattersText.setText("<html><font size=+2><b>Your opinion matters to us!</b></font></html>");
86-
gitHubContact.setText("<a href='https://github.com/redhat-developer/intellij-openshift-connector/issues'>Contact us on GitHub</a>");
86+
opinionMattersText.setText("<html><font size=+3><b>Your opinion matters to us!</b></font></html>");
87+
gitHubContact.setText("<a style='font-family:sans-serif' href='https://github.com/redhat-developer/intellij-openshift-connector/issues'>Contact us on GitHub</a>");
8788
gitHubContact.addHyperlinkListener(new HyperlinkMouseListener());
88-
marketplaceRate.setText("<a href='https://plugins.jetbrains.com/plugin/12030-openshift-toolkit-by-red-hat/'>Rate us on Marketplace</a>");
89+
marketplaceRate.setText("<a style='font-family:sans-serif' href='https://plugins.jetbrains.com/plugin/12030-openshift-toolkit-by-red-hat/'>Rate us on Marketplace</a>");
8990
marketplaceRate.addHyperlinkListener(new HyperlinkMouseListener());
9091

9192

@@ -119,31 +120,17 @@ protected void textChanged(@NotNull DocumentEvent e) {
119120

120121

121122
private void refreshForm() {
122-
if (slider1.getValue() <= 3) {
123-
comment1.setVisible(true);
124-
scrollPaneComment1.setVisible(true);
125-
textArea1.setVisible(true);
126-
} else {
127-
comment1.setVisible(false);
128-
scrollPaneComment1.setVisible(false);
129-
textArea1.setVisible(false);
130-
}
131-
if (slider2.getValue() <= 3) {
132-
comment2.setVisible(true);
133-
scrollPaneComment2.setVisible(true);
134-
textArea2.setVisible(true);
135-
} else {
136-
comment2.setVisible(false);
137-
scrollPaneComment2.setVisible(false);
138-
textArea2.setVisible(false);
139-
}
140-
if (Objects.equals(comboBox1.getSelectedItem(), "Yes")) {
141-
comment3.setVisible(true);
142-
textField3.setVisible(true);
143-
} else {
144-
comment3.setVisible(false);
145-
textField3.setVisible(false);
146-
}
123+
setVisible(slider1.getValue() <= 3,
124+
comment1, scrollPaneComment1, textArea1);
125+
setVisible(slider2.getValue() <= 3,
126+
comment2, scrollPaneComment2, textArea2);
127+
setVisible(Objects.equals(comboBox1.getSelectedItem(), "Yes"),
128+
comment3, textField3);
129+
}
130+
131+
private void setVisible(boolean visible, JComponent... components) {
132+
Arrays.asList(components)
133+
.forEach(component -> component.setVisible(visible));
147134
}
148135

149136
@Override

0 commit comments

Comments
 (0)