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

Commit 9cd52c9

Browse files

File tree

13 files changed

+990
-18
lines changed

13 files changed

+990
-18
lines changed

pom.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,24 @@
6666
<target>1.7</target>
6767
</configuration>
6868
</plugin>
69-
<plugin>
70-
<groupId>org.codehaus.mojo</groupId>
71-
<artifactId>ideauidesigner-maven-plugin</artifactId>
72-
<version>1.0-beta-1</version>
73-
<executions>
74-
<execution>
75-
<goals>
76-
<goal>javac2</goal>
77-
</goals>
78-
</execution>
79-
</executions>
69+
<!-- <plugin>-->
70+
<!-- <groupId>org.codehaus.mojo</groupId>-->
71+
<!-- <artifactId>ideauidesigner-maven-plugin</artifactId>-->
72+
<!-- <version>1.0-beta-1</version>-->
73+
<!-- <executions>-->
74+
<!-- <execution>-->
75+
<!-- <goals>-->
76+
<!-- <goal>javac2</goal>-->
77+
<!-- </goals>-->
78+
<!-- </execution>-->
79+
<!-- </executions>-->
8080

81-
<configuration>
82-
<fork>true</fork>
83-
<debug>true</debug>
84-
<failOnError>true</failOnError>
85-
</configuration>
86-
</plugin>
81+
<!-- <configuration>-->
82+
<!-- <fork>true</fork>-->
83+
<!-- <debug>true</debug>-->
84+
<!-- <failOnError>true</failOnError>-->
85+
<!-- </configuration>-->
86+
<!-- </plugin>-->
8787
<plugin>
8888
<groupId>org.sonatype.plugins</groupId>
8989
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -192,7 +192,7 @@
192192
<dependency>
193193
<groupId>com.intellij</groupId>
194194
<artifactId>forms_rt</artifactId>
195-
<version>5.0</version>
195+
<version>7.0.3</version>
196196
</dependency>
197197
<dependency>
198198
<groupId>jgoodies</groupId>

src/main/java/com/tagmycode/plugin/gui/form/AboutDialog.java

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.tagmycode.plugin.gui.form;
22

3+
import com.intellij.uiDesigner.core.GridConstraints;
4+
import com.intellij.uiDesigner.core.GridLayoutManager;
5+
import com.intellij.uiDesigner.core.Spacer;
6+
import com.jgoodies.forms.layout.CellConstraints;
7+
import com.jgoodies.forms.layout.FormLayout;
38
import com.tagmycode.plugin.AbstractVersion;
49
import com.tagmycode.plugin.Framework;
510
import com.tagmycode.plugin.gui.GuiUtil;
@@ -88,4 +93,112 @@ public JComponent getMainComponent() {
8893
protected void onOK() {
8994

9095
}
96+
97+
{
98+
// GUI initializer generated by IntelliJ IDEA GUI Designer
99+
// >>> IMPORTANT!! <<<
100+
// DO NOT EDIT OR ADD ANY CODE HERE!
101+
$$$setupUI$$$();
102+
}
103+
104+
/**
105+
* Method generated by IntelliJ IDEA GUI Designer
106+
* >>> IMPORTANT!! <<<
107+
* DO NOT edit this method OR call it in your code!
108+
*
109+
* @noinspection ALL
110+
*/
111+
private void $$$setupUI$$$() {
112+
contentPane = new JPanel();
113+
contentPane.setLayout(new GridLayoutManager(8, 1, new Insets(10, 10, 10, 10), -1, -1));
114+
final JPanel panel1 = new JPanel();
115+
panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
116+
contentPane.add(panel1, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
117+
final JPanel panel2 = new JPanel();
118+
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
119+
panel1.add(panel2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
120+
buttonCancel = new JButton();
121+
buttonCancel.setText("Close");
122+
panel2.add(buttonCancel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
123+
licenseButton = new JButton();
124+
licenseButton.setText("License");
125+
panel1.add(licenseButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
126+
reportAnIssueButton = new JButton();
127+
reportAnIssueButton.setText("Report an issue");
128+
panel1.add(reportAnIssueButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
129+
final JPanel panel3 = new JPanel();
130+
panel3.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
131+
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
132+
final JLabel label1 = new JLabel();
133+
label1.setIcon(new ImageIcon(getClass().getResource("/images/tagmycode_logo.png")));
134+
label1.setText("");
135+
panel3.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
136+
final JPanel panel4 = new JPanel();
137+
panel4.setLayout(new FormLayout("fill:d:grow", "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:d:grow,top:4dlu:noGrow,top:4dlu:noGrow"));
138+
contentPane.add(panel4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
139+
pluginVersionLabel = new JLabel();
140+
pluginVersionLabel.setText("Plugin version:");
141+
CellConstraints cc = new CellConstraints();
142+
panel4.add(pluginVersionLabel, cc.xy(1, 3));
143+
frameworkBuildDateLabel = new JLabel();
144+
frameworkBuildDateLabel.setText("Framework build date:");
145+
panel4.add(frameworkBuildDateLabel, cc.xy(1, 9));
146+
title = new JLabel();
147+
Font titleFont = this.$$$getFont$$$(null, Font.BOLD, 16, title.getFont());
148+
if (titleFont != null) title.setFont(titleFont);
149+
title.setText("TagMyCode Plugin");
150+
panel4.add(title, cc.xy(1, 1));
151+
frameworkVersionLabel = new JLabel();
152+
frameworkVersionLabel.setText("Framework version:");
153+
panel4.add(frameworkVersionLabel, cc.xy(1, 7));
154+
final Spacer spacer1 = new Spacer();
155+
panel4.add(spacer1, cc.xy(1, 15, CellConstraints.DEFAULT, CellConstraints.FILL));
156+
final JToolBar.Separator toolBar$Separator1 = new JToolBar.Separator();
157+
panel4.add(toolBar$Separator1, cc.xy(1, 5));
158+
final JLabel label2 = new JLabel();
159+
label2.setText("User directory:");
160+
panel4.add(label2, cc.xy(1, 11));
161+
userDirectoryTextField = new JTextField();
162+
userDirectoryTextField.setEditable(false);
163+
panel4.add(userDirectoryTextField, cc.xy(1, 13, CellConstraints.FILL, CellConstraints.DEFAULT));
164+
final JPanel panel5 = new JPanel();
165+
panel5.setLayout(new BorderLayout(0, 0));
166+
contentPane.add(panel5, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(-1, 30), null, 0, false));
167+
final JSeparator separator1 = new JSeparator();
168+
panel5.add(separator1, BorderLayout.CENTER);
169+
tagmycodeLinkLabel = new JLabel();
170+
tagmycodeLinkLabel.setHorizontalAlignment(0);
171+
tagmycodeLinkLabel.setText("<html><a href=\"\">www.tagmycode.com</a>");
172+
contentPane.add(tagmycodeLinkLabel, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
173+
final Spacer spacer2 = new Spacer();
174+
contentPane.add(spacer2, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
175+
final Spacer spacer3 = new Spacer();
176+
contentPane.add(spacer3, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
177+
}
178+
179+
/**
180+
* @noinspection ALL
181+
*/
182+
private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) {
183+
if (currentFont == null) return null;
184+
String resultName;
185+
if (fontName == null) {
186+
resultName = currentFont.getName();
187+
} else {
188+
Font testFont = new Font(fontName, Font.PLAIN, 10);
189+
if (testFont.canDisplay('a') && testFont.canDisplay('1')) {
190+
resultName = fontName;
191+
} else {
192+
resultName = currentFont.getName();
193+
}
194+
}
195+
return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
196+
}
197+
198+
/**
199+
* @noinspection ALL
200+
*/
201+
public JComponent $$$getRootComponent$$$() {
202+
return contentPane;
203+
}
91204
}

src/main/java/com/tagmycode/plugin/gui/form/FiltersPanelForm.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,30 @@ public void reset() {
115115
selectLanguageOnTree(null);
116116
filterLanguage(null);
117117
}
118+
119+
{
120+
// GUI initializer generated by IntelliJ IDEA GUI Designer
121+
// >>> IMPORTANT!! <<<
122+
// DO NOT EDIT OR ADD ANY CODE HERE!
123+
$$$setupUI$$$();
124+
}
125+
126+
/**
127+
* Method generated by IntelliJ IDEA GUI Designer
128+
* >>> IMPORTANT!! <<<
129+
* DO NOT edit this method OR call it in your code!
130+
*
131+
* @noinspection ALL
132+
*/
133+
private void $$$setupUI$$$() {
134+
mainComponent = new JPanel();
135+
mainComponent.setLayout(new BorderLayout(0, 0));
136+
}
137+
138+
/**
139+
* @noinspection ALL
140+
*/
141+
public JComponent $$$getRootComponent$$$() {
142+
return mainComponent;
143+
}
118144
}

src/main/java/com/tagmycode/plugin/gui/form/LoginDialog.java

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.tagmycode.plugin.gui.form;
22

3+
import com.intellij.uiDesigner.core.GridConstraints;
4+
import com.intellij.uiDesigner.core.GridLayoutManager;
5+
import com.intellij.uiDesigner.core.Spacer;
6+
import com.jgoodies.forms.layout.CellConstraints;
7+
import com.jgoodies.forms.layout.FormLayout;
38
import com.tagmycode.plugin.Framework;
49
import com.tagmycode.plugin.exception.TagMyCodeGuiException;
510
import com.tagmycode.plugin.operation.LoginOperation;
@@ -95,4 +100,95 @@ public JButton getButtonOK() {
95100
public JTextField getVerificationCodeTextField() {
96101
return verificationCodeTextField;
97102
}
103+
104+
{
105+
// GUI initializer generated by IntelliJ IDEA GUI Designer
106+
// >>> IMPORTANT!! <<<
107+
// DO NOT EDIT OR ADD ANY CODE HERE!
108+
$$$setupUI$$$();
109+
}
110+
111+
/**
112+
* Method generated by IntelliJ IDEA GUI Designer
113+
* >>> IMPORTANT!! <<<
114+
* DO NOT edit this method OR call it in your code!
115+
*
116+
* @noinspection ALL
117+
*/
118+
private void $$$setupUI$$$() {
119+
contentPane = new JPanel();
120+
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
121+
final JPanel panel1 = new JPanel();
122+
panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
123+
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
124+
final Spacer spacer1 = new Spacer();
125+
panel1.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
126+
final JPanel panel2 = new JPanel();
127+
panel2.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false));
128+
panel1.add(panel2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
129+
buttonOK = new JButton();
130+
buttonOK.setText("OK");
131+
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
132+
buttonCancel = new JButton();
133+
buttonCancel.setText("Cancel");
134+
panel2.add(buttonCancel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
135+
signupLabel = new JLabel();
136+
signupLabel.setText("<html><a href=\"\">Sign Up for Free</a></html>");
137+
panel1.add(signupLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
138+
final JPanel panel3 = new JPanel();
139+
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
140+
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
141+
jPanelVerification = new JPanel();
142+
jPanelVerification.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
143+
panel3.add(jPanelVerification, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
144+
final JPanel panel4 = new JPanel();
145+
panel4.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
146+
jPanelVerification.add(panel4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
147+
openLinkButton = new JButton();
148+
Font openLinkButtonFont = this.$$$getFont$$$(null, Font.BOLD, -1, openLinkButton.getFont());
149+
if (openLinkButtonFont != null) openLinkButton.setFont(openLinkButtonFont);
150+
openLinkButton.setText("Authenticate...");
151+
panel4.add(openLinkButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
152+
final JLabel label1 = new JLabel();
153+
label1.setIcon(new ImageIcon(getClass().getResource("/images/tagmycode_logo.png")));
154+
label1.setText("");
155+
panel4.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
156+
final JPanel panel5 = new JPanel();
157+
panel5.setLayout(new FormLayout("fill:d:grow", "center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
158+
jPanelVerification.add(panel5, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
159+
verificationCodeTextField = new JTextField();
160+
Font verificationCodeTextFieldFont = this.$$$getFont$$$(null, Font.BOLD, 16, verificationCodeTextField.getFont());
161+
if (verificationCodeTextFieldFont != null) verificationCodeTextField.setFont(verificationCodeTextFieldFont);
162+
CellConstraints cc = new CellConstraints();
163+
panel5.add(verificationCodeTextField, new CellConstraints(1, 3, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT, new Insets(0, 10, 0, 10)));
164+
final JLabel label2 = new JLabel();
165+
label2.setText("Paste the verification code here:");
166+
panel5.add(label2, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));
167+
}
168+
169+
/**
170+
* @noinspection ALL
171+
*/
172+
private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) {
173+
if (currentFont == null) return null;
174+
String resultName;
175+
if (fontName == null) {
176+
resultName = currentFont.getName();
177+
} else {
178+
Font testFont = new Font(fontName, Font.PLAIN, 10);
179+
if (testFont.canDisplay('a') && testFont.canDisplay('1')) {
180+
resultName = fontName;
181+
} else {
182+
resultName = currentFont.getName();
183+
}
184+
}
185+
return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
186+
}
187+
188+
/**
189+
* @noinspection ALL
190+
*/
191+
public JComponent $$$getRootComponent$$$() {
192+
return contentPane;
193+
}
98194
}

0 commit comments

Comments
 (0)