• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SaveAndSyncHandler类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.intellij.ide.SaveAndSyncHandler的典型用法代码示例。如果您正苦于以下问题:Java SaveAndSyncHandler类的具体用法?Java SaveAndSyncHandler怎么用?Java SaveAndSyncHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SaveAndSyncHandler类属于com.intellij.ide包,在下文中一共展示了SaveAndSyncHandler类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: synchronizeFiles

点赞 3

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
public static void synchronizeFiles() {
  /**
   * Run in SYNC in unit test mode, and {@link com.twitter.intellij.pants.testFramework.PantsIntegrationTestCase.doImport}
   * is required to be wrapped in WriteAction. Otherwise it will run in async mode.
   */
  if (ApplicationManager.getApplication().isUnitTestMode() && ApplicationManager.getApplication().isWriteAccessAllowed()) {
    ApplicationManager.getApplication().runWriteAction(() -> {
      FileDocumentManager.getInstance().saveAllDocuments();
      SaveAndSyncHandler.getInstance().refreshOpenFiles();
      VirtualFileManager.getInstance().refreshWithoutFileWatcher(false); /** synchronous */
    });
  }
  else {
    ApplicationManager.getApplication().invokeLater(() -> {
      FileDocumentManager.getInstance().saveAllDocuments();
      SaveAndSyncHandler.getInstance().refreshOpenFiles();
      VirtualFileManager.getInstance().refreshWithoutFileWatcher(true); /** asynchronous */
    });
  }
}
 

开发者ID:pantsbuild,
项目名称:intellij-pants-plugin,
代码行数:21,
代码来源:PantsUtil.java

示例2: processTerminated

点赞 3

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@Override
public void processTerminated(ProcessEvent event) {
  if (myProject.isDisposed()) return;
  if (!myTerminateNotified.compareAndSet(false, true)) return;

  ApplicationManager.getApplication().invokeLater(() -> {
    RunnerLayoutUi ui = myDescriptor.getRunnerLayoutUi();
    if (ui != null && !ui.isDisposed()) {
      ui.updateActionsNow();
    }
  }, ModalityState.any());

  myProject.getMessageBus().syncPublisher(EXECUTION_TOPIC).processTerminated(myExecutorId, myEnvironment, myProcessHandler, event.getExitCode());

  SaveAndSyncHandler saveAndSyncHandler = SaveAndSyncHandler.getInstance();
  if (saveAndSyncHandler != null) {
    saveAndSyncHandler.scheduleRefresh();
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:20,
代码来源:ExecutionManagerImpl.java

示例3: processTerminated

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@Override
public void processTerminated(ProcessEvent event) {
  if (myProject.isDisposed()) return;

  myProject.getMessageBus().syncPublisher(EXECUTION_TOPIC).processTerminated(myProfile, myProcessHandler);

  SaveAndSyncHandler saveAndSyncHandler = SaveAndSyncHandler.getInstance();
  if (saveAndSyncHandler != null) {
    saveAndSyncHandler.scheduleRefresh();
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:ExecutionManagerImpl.java

示例4: synchronize

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
public static void synchronize() {
  FileDocumentManager.getInstance().saveAllDocuments();
  SaveAndSyncHandler.getInstance().refreshOpenFiles();
  VirtualFileManager.getInstance().refreshWithoutFileWatcher(true);
}
 

开发者ID:medvector,
项目名称:educational-plugin,
代码行数:6,
代码来源:EduUtils.java

示例5: createCenterPanel

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
protected JComponent createCenterPanel() {
  JPanel panel = new MyPanel();

  myUiUpdater = new MergingUpdateQueue("FileChooserUpdater", 200, false, panel);
  Disposer.register(myDisposable, myUiUpdater);
  new UiNotifyConnector(panel, myUiUpdater);

  panel.setBorder(JBUI.Borders.empty());

  createTree();

  final DefaultActionGroup group = createActionGroup();
  ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
  toolBar.setTargetComponent(panel);

  final JPanel toolbarPanel = new JPanel(new BorderLayout());
  toolbarPanel.add(toolBar.getComponent(), BorderLayout.CENTER);

  myTextFieldAction = new TextFieldAction() {
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      toggleShowTextField();
    }
  };
  toolbarPanel.add(myTextFieldAction, BorderLayout.EAST);
  JPanel extraToolbarPanel = createExtraToolbarPanel();
  if(extraToolbarPanel != null){
    toolbarPanel.add(extraToolbarPanel, BorderLayout.SOUTH);
  }

  myPathTextFieldWrapper = new JPanel(new BorderLayout());
  myPathTextFieldWrapper.setBorder(JBUI.Borders.emptyBottom(2));
  myPathTextField = new FileTextFieldImpl.Vfs(
    FileChooserFactoryImpl.getMacroMap(), getDisposable(),
    new LocalFsFinder.FileChooserFilter(myChooserDescriptor, myFileSystemTree)) {
    protected void onTextChanged(final String newValue) {
      myUiUpdater.cancelAllUpdates();
      updateTreeFromPath(newValue);
    }
  };
  Disposer.register(myDisposable, myPathTextField);
  myPathTextFieldWrapper.add(myPathTextField.getField(), BorderLayout.CENTER);
  if (getRecentFiles().length > 0) {
    myPathTextFieldWrapper.add(createHistoryButton(), BorderLayout.EAST);
  }

  myNorthPanel = new JPanel(new BorderLayout());
  myNorthPanel.add(toolbarPanel, BorderLayout.NORTH);


  updateTextFieldShowing();

  panel.add(myNorthPanel, BorderLayout.NORTH);

  registerMouseListener(group);

  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree());
  //scrollPane.setBorder(BorderFactory.createLineBorder(new Color(148, 154, 156)));
  panel.add(scrollPane, BorderLayout.CENTER);
  panel.setPreferredSize(JBUI.size(400));


  panel.add(new JLabel(DRAG_N_DROP_HINT, SwingConstants.CENTER), BorderLayout.SOUTH);


  ApplicationManager.getApplication().getMessageBus().connect(getDisposable())
    .subscribe(ApplicationActivationListener.TOPIC, new ApplicationActivationListener.Adapter() {
      @Override
      public void applicationActivated(IdeFrame ideFrame) {
        DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_MODAL, new Runnable() {
          @Override
          public void run() {
            ((SaveAndSyncHandlerImpl)SaveAndSyncHandler.getInstance()).maybeRefresh(ModalityState.current());
          }
        });
      }
    });

  return panel;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:80,
代码来源:FileChooserDialogImpl.java

示例6: actionPerformed

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  FileDocumentManager.getInstance().saveAllDocuments();
  SaveAndSyncHandler.getInstance().refreshOpenFiles();
  VirtualFileManager.getInstance().refreshWithoutFileWatcher(true);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:7,
代码来源:SynchronizeAction.java

示例7: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@NotNull
SaveAndSyncHandler getSaveAndSyncHandler();
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:3,
代码来源:DvcsPlatformFacade.java

示例8: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@NotNull
@Override
public SaveAndSyncHandler getSaveAndSyncHandler() {
  return SaveAndSyncHandler.getInstance();
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:DvcsPlatformFacadeImpl.java

示例9: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@NotNull
@Override
public SaveAndSyncHandler getSaveAndSyncHandler() {
  return EasyMock.createMock(SaveAndSyncHandler.class);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:6,
代码来源:DvcsTestPlatformFacade.java

示例10: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@NotNull
@Override
public SaveAndSyncHandler getSaveAndSyncHandler() {
  return SaveAndSyncHandlerImpl.getInstance();
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:6,
代码来源:DvcsPlatformFacadeImpl.java

示例11: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@Nonnull
SaveAndSyncHandler getSaveAndSyncHandler();
 

开发者ID:consulo,
项目名称:consulo,
代码行数:3,
代码来源:DvcsPlatformFacade.java

示例12: getSaveAndSyncHandler

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
@Nonnull
@Override
public SaveAndSyncHandler getSaveAndSyncHandler() {
  return SaveAndSyncHandlerImpl.getInstance();
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:6,
代码来源:DvcsPlatformFacadeImpl.java

示例13: createCenterPanel

点赞 2

import com.intellij.ide.SaveAndSyncHandler; //导入依赖的package包/类
protected JComponent createCenterPanel() {
  JPanel panel = new MyPanel();

  myUiUpdater = new MergingUpdateQueue("FileChooserUpdater", 200, false, panel);
  Disposer.register(myDisposable, myUiUpdater);
  new UiNotifyConnector(panel, myUiUpdater);

  panel.setBorder(JBUI.Borders.empty());

  createTree();

  final DefaultActionGroup group = createActionGroup();
  ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true);
  toolBar.setTargetComponent(panel);

  final JPanel toolbarPanel = new JPanel(new BorderLayout());
  toolbarPanel.add(toolBar.getComponent(), BorderLayout.CENTER);

  myTextFieldAction = new TextFieldAction() {
    public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
      toggleShowTextField();
    }
  };
  toolbarPanel.add(myTextFieldAction, BorderLayout.EAST);
  JPanel extraToolbarPanel = createExtraToolbarPanel();
  if (extraToolbarPanel != null) {
    toolbarPanel.add(extraToolbarPanel, BorderLayout.SOUTH);
  }

  myPathTextFieldWrapper = new JPanel(new BorderLayout());
  myPathTextFieldWrapper.setBorder(JBUI.Borders.emptyBottom(2));
  myPathTextField = new FileTextFieldImpl.Vfs(FileChooserFactoryImpl.getMacroMap(), getDisposable(),
                                              new LocalFsFinder.FileChooserFilter(myChooserDescriptor, myFileSystemTree)) {
    protected void onTextChanged(final String newValue) {
      myUiUpdater.cancelAllUpdates();
      updateTreeFromPath(newValue);
    }
  };
  Disposer.register(myDisposable, myPathTextField);
  myPathTextFieldWrapper.add(myPathTextField.getField(), BorderLayout.CENTER);
  if (getRecentFiles().length > 0) {
    myPathTextFieldWrapper.add(createHistoryButton(), BorderLayout.EAST);
  }

  myNorthPanel = new JPanel(new BorderLayout());
  myNorthPanel.add(toolbarPanel, BorderLayout.NORTH);


  updateTextFieldShowing();

  panel.add(myNorthPanel, BorderLayout.NORTH);

  registerMouseListener(group);

  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myFileSystemTree.getTree());
  //scrollPane.setBorder(BorderFactory.createLineBorder(new Color(148, 154, 156)));
  panel.add(scrollPane, BorderLayout.CENTER);
  panel.setPreferredSize(JBUI.size(400));


  JLabel hintLabel = new JLabel(DRAG_N_DROP_HINT, SwingConstants.CENTER);
  hintLabel.setForeground(JBColor.gray);
  hintLabel.setFont(JBUI.Fonts.smallFont());
  panel.add(hintLabel, BorderLayout.SOUTH);

  ApplicationManager.getApplication().getMessageBus().connect(getDisposable())
          .subscribe(ApplicationActivationListener.TOPIC, new ApplicationActivationListener() {
            @Override
            public void applicationActivated(IdeFrame ideFrame) {
              ((SaveAndSyncHandlerImpl)SaveAndSyncHandler.getInstance()).maybeRefresh(ModalityState.current());
            }
          });

  return panel;
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:76,
代码来源:FileChooserDialogImpl.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)