public void actionPerformed(final AnActionEvent event) { ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { public void run() { androidWifiADB.updateProject(event.getProject()); androidWifiADB.connectDevices(); } }); } }
@Override public void disconnectDevice(final Device device) { ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { public void run() { androidWifiADB.disconnectDevice(device); updateUi(); } }); }
private void updateUi() { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { cardLayoutDevices.setDevices(androidWifiADB.getDevices()); cardLayoutDevices.updateUi(); } }); } }
public static void showNotification(final String message, final NotificationType type) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { Notification notification = NOTIFICATION_GROUP.createNotification(ANDROID_WIFI_ADB_TITLE, message, type, null); Notifications.Bus.notify(notification); } }); } }
@Override public void connectDevice(final Device device) { ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { public void run() { androidWifiADB.connectDevice(device); updateUi(); } }); }
private void setupUI() { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { cardLayoutDevices.createAndShowGUI(); } }); }
public void run() { ApplicationManager.getApplication().runReadAction(cmd); } }
public void run() { ApplicationManager.getApplication().runWriteAction(cmd); } }
private static void readActionInPooledThread(@NotNull Runnable runnable) { ApplicationManager.getApplication().executeOnPooledThread(() -> ApplicationManager.getApplication().runReadAction(runnable)); }
private void monitorDevices() { ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { public void run() { new Timer().schedule(new TimerTask() { @Override public void run() { boolean refreshRequired = androidWifiADB.refreshDevicesList(); if (refreshRequired) { updateUi(); } } }, 0, INTERVAL_REFRESH_DEVICES); } }); }
@NotNull private static VimPlugin getInstance() { return (VimPlugin)ApplicationManager.getApplication().getComponent(IDEAVIM_COMPONENT_NAME); }
private void close(@Nullable final KeyEvent e) { ApplicationManager.getApplication().invokeLater(new Runnable() { public void run() { deactivate(true); final Project project = myEditor.getProject(); if (project != null && e != null && e.getKeyChar() != '\n') { final KeyStroke key = KeyStroke.getKeyStrokeForEvent(e); final List<KeyStroke> keys = new ArrayList<KeyStroke>(1); keys.add(key); VimPlugin.getMacro().playbackKeys(myEditor, new EditorDataContext(myEditor), project, keys, 0, 0, 1); } } }); }
@NotNull private static String getSrcLocation(@NotNull String version) { if (ApplicationManager.getApplication().isUnitTestMode()) { return "src/pkg"; } if (version.startsWith("devel")) { return "src"; } if (version.length() > 2 && StringUtil.parseDouble(version.substring(0, 3), 1.4) < 1.4) { return "src/pkg"; } return "src"; }
private static void readActionInPooledThread(@NotNull Runnable runnable) { ApplicationManager.getApplication().executeOnPooledThread(() -> ApplicationManager.getApplication().runReadAction(runnable)); }
public boolean execute(@NotNull Editor editor, @NotNull final DataContext context, @NotNull ExCommand cmd) throws ExException { // TODO: Check the command argument and jump to a specific symbol ApplicationManager.getApplication().invokeLater(() -> KeyHandler.executeAction("GotoSymbol", context)); return true; } }
/** * Get Ignore Application Component * * @return Ignore Application Component */ @NotNull public static IgnoreApplicationComponent getInstance() { return ApplicationManager.getApplication().getComponent(IgnoreApplicationComponent.class); }
public static void clearError() { if (ApplicationManager.getApplication().isUnitTestMode()) { getInstance().error = false; } }
public void editorCreated(@NotNull EditorFactoryEvent event) { final Editor editor = event.getEditor(); // This ridiculous code ensures that a lot of events are processed BEFORE we finally start listening // to visible area changes. The primary reason for this change is to fix the cursor position bug // using the gd and gD commands (Goto Declaration). This bug has been around since Idea 6.0.4? // Prior to this change the visible area code was moving the cursor around during file load and messing // with the cursor position of the Goto Declaration processing. ApplicationManager.getApplication().invokeLater( () -> ApplicationManager.getApplication().invokeLater( () -> ApplicationManager.getApplication().invokeLater( () -> { addEditorListener(editor); EditorData.setMotionGroup(editor, true); }) ) ); }
private void autoImport(@NotNull InsertionContext context, @Nullable String organization, @NotNull String packageName, @Nullable String alias) { PsiFile file = context.getFile(); final String importPath = organization == null ? packageName : organization + "/" + packageName; ApplicationManager.getApplication().runWriteAction(() -> { BallerinaFile.addImport(((BallerinaFile) file), importPath, alias); }); }
/** * Creates the class */ public MarkGroup() { EventFacade.getInstance().addEditorFactoryListener(new EditorFactoryAdapter() { public void editorReleased(@NotNull EditorFactoryEvent event) { // Save off the last caret position of the file before it is closed Editor editor = event.getEditor(); setMark(editor, '"', editor.getCaretModel().getOffset()); } }, ApplicationManager.getApplication()); }