Skip to content

Instantly share code, notes, and snippets.

@rahul-lohra
Last active July 19, 2020 04:09
Show Gist options
  • Save rahul-lohra/0f1a04b17897bbfba82eec2279b7e835 to your computer and use it in GitHub Desktop.
Save rahul-lohra/0f1a04b17897bbfba82eec2279b7e835 to your computer and use it in GitHub Desktop.
Import Logic
package com.rahul.gqlformat;
import com.intellij.openapi.project.Project;
import org.apache.http.util.TextUtils;
import javax.swing.*;
public class GqlView {
private JTextArea textArea;
private JButton btnImport;
private JPanel panel;
private JTextField tfVariableName;
private JButton btnReplace;
private JLabel labelError;
private Project project;
private EditorLogic editorLogic;
Timer errorTimer;
public GqlView(Project project) {
this.editorLogic = new EditorLogic();
this.project = project;
btnImport.addActionListener(actionEvent -> {
String variableName = tfVariableName.getText();
if (TextUtils.isEmpty(variableName)) {
//Do nothing
} else {
editorLogic.selectCurrentFile(variableName, project, textArea);
}
});
}
public JPanel getPanel() {
return panel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment