Skip to content

Instantly share code, notes, and snippets.

@TrevCan
Created October 9, 2019 13:38
Show Gist options
  • Save TrevCan/397ac3b79fdeb9ad60c48ef6973c5bc5 to your computer and use it in GitHub Desktop.
Save TrevCan/397ac3b79fdeb9ad60c48ef6973c5bc5 to your computer and use it in GitHub Desktop.
hello action intellij idea plugin test
import android.os.Message;
import b.d.T;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.plaf.FileChooserUI;
import java.awt.*;
import java.io.IOException;
import java.util.function.Consumer;
import static b.c.c8.f;
import static com.intellij.patterns.PsiJavaPatterns.virtualFile;
import static groovy.ui.text.FindReplaceUtility.showDialog;
public class HelloAction extends AnAction {
private Object VirtualFile;
@Override
public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
Messages.showMessageDialog("Hello World message", "Tecbot", IconLoader.getIcon("/icon.png"));
FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false);
fileChooserDescriptor.setTitle("FILE_CHOOSER_TITLE");
fileChooserDescriptor.setDescription("YOU CAN CHOOSE A DIRECTORY WITH THIS");
VirtualFile virtualFile = null;
//FileChooser.chooseFile(fileChooserDescriptor, null, virtualFile, null);
//fileChooserDescriptor.
VirtualFile files = FileChooser.chooseFile(fileChooserDescriptor, (Component) null, null, null);
if(files.getPath()!=null){
Messages.showMessageDialog((Project) null,files.getPath(), "PATH", Messages.getInformationIcon());}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment