当前位置: 首页>>代码示例>>Java>>正文


Java ProjectManagerListener类代码示例

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


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

示例1: initComponent

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Override
public void initComponent() {
    MessageBus bus = ApplicationManager.getApplication().getMessageBus();
    connection = bus.connect();

    ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerListener() {
        @Override
        public void projectOpened(Project project) {
            Config config = Config.getInstance(project);

            if(config == null) {
                return;
            }

            if(!config.isConfigFilled()) {
                Notifications.Bus.notify(
                        new Notification("Settings Error", "Gherkin TS Runner", "Settings have to be filled.", NotificationType.WARNING)
                );
                return;
            }

            connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new GherkinFileEditorManagerListener(project));
        }
    });

}
 
开发者ID:KariiO,项目名称:Gherkin-TS-Runner,代码行数:27,代码来源:MainComponent.java

示例2: canClose

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Override
public boolean canClose(Project project) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("enter: canClose()");
  }

  for (ProjectManagerListener listener : myListeners) {
    try {
      if (!listener.canCloseProject(project)) return false;
    }
    catch (Throwable e) {
      LOG.warn(e); // DO NOT LET ANY PLUGIN to prevent closing due to exception
    }
  }

  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:ProjectManagerImpl.java

示例3: AppEngineRuntimeInstance

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
AppEngineRuntimeInstance() {
  createdDeployments = ArrayListMultimap.create();
  projectClosingListener =
      new ProjectManagerListener() {
        @Override
        public void projectClosing(Project project) {
          disconnect();
        }
      };
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:11,代码来源:AppEngineRuntimeInstance.java

示例4: replaceStatusBar

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
private void replaceStatusBar() {
  final MessageBusConnection connect = ApplicationManager.getApplication().getMessageBus().connect();

  // On app init, set the statusbar borders
  connect.subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
    @Override
    public void projectOpened(@Nullable final Project projectFromCommandLine) {
      MTThemeManager.getInstance().setStatusBarBorders();
    }
  });

  // And also on config change
  connect.subscribe(ConfigNotifier.CONFIG_TOPIC, mtConfig -> MTThemeManager.getInstance().setStatusBarBorders());
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:15,代码来源:MTLafComponent.java

示例5: fireProjectClosing

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
private void fireProjectClosing(Project project) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("enter: fireProjectClosing()");
  }

  for (ProjectManagerListener listener : myListeners) {
    try {
      listener.projectClosing(project);
    }
    catch (Exception e) {
      LOG.error(e);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ProjectManagerImpl.java

示例6: addProjectManagerListener

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Override
public void addProjectManagerListener(@NotNull final ProjectManagerListener listener, @NotNull Disposable parentDisposable) {
  addProjectManagerListener(listener);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      removeProjectManagerListener(listener);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ProjectManagerImpl.java

示例7: removeProjectManagerListener

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Override
public void removeProjectManagerListener(@NotNull Project project, @NotNull ProjectManagerListener listener) {
  List<ProjectManagerListener> listeners = project.getUserData(LISTENERS_IN_PROJECT_KEY);
  LOG.assertTrue(listeners != null);
  boolean removed = listeners.remove(listener);
  LOG.assertTrue(removed);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ProjectManagerImpl.java

示例8: fireProjectOpened

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
private void fireProjectOpened(Project project) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("projectOpened");
  }

  for (ProjectManagerListener listener : myListeners) {
    try {
      listener.projectOpened(project);
    }
    catch (Exception e) {
      LOG.error(e);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ProjectManagerImpl.java

示例9: fireProjectClosed

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
private void fireProjectClosed(Project project) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("projectClosed");
  }

  for (ProjectManagerListener listener : myListeners) {
    try {
      listener.projectClosed(project);
    }
    catch (Exception e) {
      LOG.error(e);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ProjectManagerImpl.java

示例10: WebWelcomeFrameManager

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Inject
public WebWelcomeFrameManager(@Nonnull Application application) {
  application.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
    @Override
    public void projectOpened(Project project) {
      Window window = myWindow;

      myWindow = null;

      if (window != null) {
        WebApplication.invokeOnCurrentSession(window::close);
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:WebWelcomeFrameManager.java

示例11: addNotify

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@Override
public void addNotify() {
  myDisposable = Disposer.newDisposable("ETF dispose");
  Disposer.register(myDisposable, this::releaseEditorLater);
  if (myProject != null) {
    ProjectManagerListener listener = new ProjectManagerListener() {
      @Override
      public void projectClosing(Project project) {
        releaseEditor(myEditor);
        myEditor = null;
      }
    };
    ProjectManager.getInstance().addProjectManagerListener(myProject, listener);
    Disposer.register(myDisposable, ()->ProjectManager.getInstance().removeProjectManagerListener(myProject, listener));
  }

  if (myEditor != null) {
    releaseEditorLater();
  }

  boolean isFocused = isFocusOwner();

  initEditor();

  super.addNotify();

  if (myNextFocusable != null) {
    myEditor.getContentComponent().setNextFocusableComponent(myNextFocusable);
    myNextFocusable = null;
  }
  revalidate();
  if (isFocused) {
    IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(this);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:36,代码来源:EditorTextField.java

示例12: getListeners

import com.intellij.openapi.project.ProjectManagerListener; //导入依赖的package包/类
@NotNull
private static List<ProjectManagerListener> getListeners(Project project) {
  List<ProjectManagerListener> array = project.getUserData(LISTENERS_IN_PROJECT_KEY);
  if (array == null) return Collections.emptyList();
  return array;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:ProjectManagerImpl.java


注:本文中的com.intellij.openapi.project.ProjectManagerListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。