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


Java EventDispatcher类代码示例

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


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

示例1: XBreakpointManagerImpl

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public XBreakpointManagerImpl(final Project project, final XDebuggerManagerImpl debuggerManager, StartupManager startupManager) {
  myProject = project;
  myDebuggerManager = debuggerManager;
  myAllBreakpointsDispatcher = EventDispatcher.create(XBreakpointListener.class);
  myDependentBreakpointManager = new XDependentBreakpointManager(this);
  myLineBreakpointManager = new XLineBreakpointManager(project, myDependentBreakpointManager, startupManager);
  if (!project.isDefault()) {
    if (!ApplicationManager.getApplication().isUnitTestMode()) {
      HttpVirtualFileListener httpVirtualFileListener = new HttpVirtualFileListener() {
        @Override
        public void fileDownloaded(@NotNull final VirtualFile file) {
          updateBreakpointInFile(file);
        }
      };
      HttpFileSystem.getInstance().addFileListener(httpVirtualFileListener, project);
    }
    for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) {
      addDefaultBreakpoint(type);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:XBreakpointManagerImpl.java

示例2: addBreakpoint

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private <T extends XBreakpointProperties> void addBreakpoint(final XBreakpointBase<?, T, ?> breakpoint, final boolean defaultBreakpoint,
                                                             boolean initUI) {
  XBreakpointType type = breakpoint.getType();
  if (defaultBreakpoint) {
    LOG.assertTrue(!myDefaultBreakpoints.containsKey(type), "Cannot have more than one default breakpoint (type " + type.getId() + ")");
    myDefaultBreakpoints.put(type, breakpoint);
  }
  else {
    myBreakpoints.put(type, breakpoint);
  }
  myAllBreakpoints.add(breakpoint);
  if (breakpoint instanceof XLineBreakpointImpl) {
    myLineBreakpointManager.registerBreakpoint((XLineBreakpointImpl)breakpoint, initUI);
  }
  EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type);
  if (dispatcher != null) {
    //noinspection unchecked
    dispatcher.getMulticaster().breakpointAdded(breakpoint);
  }
  getBreakpointDispatcherMulticaster().breakpointAdded(breakpoint);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:XBreakpointManagerImpl.java

示例3: doRemoveBreakpoint

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) {
  if (isDefaultBreakpoint(breakpoint)) {
    // removing default breakpoint should just disable it
    breakpoint.setEnabled(false);
  }
  else {
    XBreakpointType type = breakpoint.getType();
    XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint;
    myBreakpoints.remove(type, breakpointBase);
    myAllBreakpoints.remove(breakpointBase);
    if (breakpointBase instanceof XLineBreakpointImpl) {
      myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase);
    }
    breakpointBase.dispose();
    EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type);
    if (dispatcher != null) {
      //noinspection unchecked
      dispatcher.getMulticaster().breakpointRemoved(breakpoint);
    }
    getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XBreakpointManagerImpl.java

示例4: XDependentBreakpointManager

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public XDependentBreakpointManager(final XBreakpointManagerImpl breakpointManager) {
  myBreakpointManager = breakpointManager;
  myDispatcher = EventDispatcher.create(XDependentBreakpointListener.class);
  myBreakpointManager.addBreakpointListener(new XBreakpointAdapter<XBreakpoint<?>>() {
    public void breakpointRemoved(@NotNull final XBreakpoint<?> breakpoint) {
      XDependentBreakpointInfo info = mySlave2Info.remove(breakpoint);
      if (info != null) {
        myMaster2Info.remove(info.myMasterBreakpoint, info);
      }

      Collection<XDependentBreakpointInfo> infos = myMaster2Info.removeAll((XBreakpointBase)breakpoint);
      if (infos != null) {
        for (XDependentBreakpointInfo breakpointInfo : infos) {
          XDependentBreakpointInfo removed = mySlave2Info.remove(breakpointInfo.mySlaveBreakpoint);
          if (removed != null) {
            myDispatcher.getMulticaster().dependencyCleared(breakpointInfo.mySlaveBreakpoint);
          }
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XDependentBreakpointManager.java

示例5: onFacetAdded

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private void onFacetAdded(final Facet facet) {
  boolean firstFacet = myFacetsByType.isEmpty();
  final FacetTypeId typeId = facet.getTypeId();
  WeakHashMap<Facet, Boolean> facets = myFacetsByType.get(typeId);
  if (facets == null) {
    facets = new WeakHashMap<Facet, Boolean>();
    myFacetsByType.put(typeId, facets);
  }
  boolean firstFacetOfType = facets.isEmpty();
  facets.put(facet, true);

  if (firstFacet) {
    getAllFacetsMulticaster().firstFacetAdded();
  }
  getAllFacetsMulticaster().facetAdded(facet);

  final EventDispatcher<ProjectWideFacetListener> dispatcher = myDispatchers.get(typeId);
  if (dispatcher != null) {
    if (firstFacetOfType) {
      dispatcher.getMulticaster().firstFacetAdded();
    }
    //noinspection unchecked
    dispatcher.getMulticaster().facetAdded(facet);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ProjectWideFacetListenersRegistryImpl.java

示例6: XBreakpointManagerImpl

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public XBreakpointManagerImpl(final Project project, final XDebuggerManagerImpl debuggerManager, StartupManager startupManager) {
  myProject = project;
  myDebuggerManager = debuggerManager;
  myAllBreakpointsDispatcher = EventDispatcher.create(XBreakpointListener.class);
  myDependentBreakpointManager = new XDependentBreakpointManager(this);
  myLineBreakpointManager = new XLineBreakpointManager(project, myDependentBreakpointManager, startupManager);
  if (!project.isDefault() && !ApplicationManager.getApplication().isUnitTestMode()) {
    HttpVirtualFileListener httpVirtualFileListener = new HttpVirtualFileListener() {
      @Override
      public void fileDownloaded(@NotNull final VirtualFile file) {
        updateBreakpointInFile(file);
      }
    };
    HttpFileSystem.getInstance().addFileListener(httpVirtualFileListener, project);
    for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) {
      addDefaultBreakpoint(type);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:XBreakpointManagerImpl.java

示例7: doRemoveBreakpoint

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) {
  XBreakpointType type = breakpoint.getType();
  XBreakpointBase<?,?,?> breakpointBase = (XBreakpointBase<?,?,?>)breakpoint;
  myBreakpoints.remove(type, breakpointBase);
  myAllBreakpoints.remove(breakpointBase);
  if (breakpointBase instanceof XLineBreakpointImpl) {
    myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase);
  }
  breakpointBase.dispose();
  EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type);
  if (dispatcher != null) {
    //noinspection unchecked
    dispatcher.getMulticaster().breakpointRemoved(breakpoint);
  }
  getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:XBreakpointManagerImpl.java

示例8: XBreakpointManagerImpl

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public XBreakpointManagerImpl(final Project project, final XDebuggerManagerImpl debuggerManager, StartupManager startupManager) {
  myProject = project;
  myDebuggerManager = debuggerManager;
  myAllBreakpointsDispatcher = EventDispatcher.create(XBreakpointListener.class);
  myDependentBreakpointManager = new XDependentBreakpointManager(this);
  myLineBreakpointManager = new XLineBreakpointManager(project, myDependentBreakpointManager, startupManager);
  if (!project.isDefault()) {
    if (!ApplicationManager.getApplication().isUnitTestMode()) {
      HttpVirtualFileListener httpVirtualFileListener = this::updateBreakpointInFile;
      HttpFileSystem.getInstance().addFileListener(httpVirtualFileListener, project);
    }
    for (XBreakpointType<?, ?> type : XBreakpointUtil.getBreakpointTypes()) {
      addDefaultBreakpoint(type);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:XBreakpointManagerImpl.java

示例9: addBreakpoint

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private <T extends XBreakpointProperties> void addBreakpoint(final XBreakpointBase<?, T, ?> breakpoint, final boolean defaultBreakpoint, boolean initUI) {
  XBreakpointType type = breakpoint.getType();
  if (defaultBreakpoint) {
    LOG.assertTrue(!myDefaultBreakpoints.containsKey(type), "Cannot have more than one default breakpoint (type " + type.getId() + ")");
    myDefaultBreakpoints.put(type, breakpoint);
  }
  else {
    myBreakpoints.put(type, breakpoint);
  }
  myAllBreakpoints.add(breakpoint);
  if (breakpoint instanceof XLineBreakpointImpl) {
    myLineBreakpointManager.registerBreakpoint((XLineBreakpointImpl)breakpoint, initUI);
  }
  EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type);
  if (dispatcher != null) {
    //noinspection unchecked
    dispatcher.getMulticaster().breakpointAdded(breakpoint);
  }
  getBreakpointDispatcherMulticaster().breakpointAdded(breakpoint);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:XBreakpointManagerImpl.java

示例10: doRemoveBreakpoint

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
private void doRemoveBreakpoint(XBreakpoint<?> breakpoint) {
  if (isDefaultBreakpoint(breakpoint)) {
    // removing default breakpoint should just disable it
    breakpoint.setEnabled(false);
  }
  else {
    XBreakpointType type = breakpoint.getType();
    XBreakpointBase<?, ?, ?> breakpointBase = (XBreakpointBase<?, ?, ?>)breakpoint;
    myBreakpoints.remove(type, breakpointBase);
    myAllBreakpoints.remove(breakpointBase);
    if (breakpointBase instanceof XLineBreakpointImpl) {
      myLineBreakpointManager.unregisterBreakpoint((XLineBreakpointImpl)breakpointBase);
    }
    breakpointBase.dispose();
    EventDispatcher<XBreakpointListener> dispatcher = myDispatchers.get(type);
    if (dispatcher != null) {
      //noinspection unchecked
      dispatcher.getMulticaster().breakpointRemoved(breakpoint);
    }
    getBreakpointDispatcherMulticaster().breakpointRemoved(breakpoint);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:XBreakpointManagerImpl.java

示例11: XDependentBreakpointManager

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public XDependentBreakpointManager(final XBreakpointManagerImpl breakpointManager) {
  myBreakpointManager = breakpointManager;
  myDispatcher = EventDispatcher.create(XDependentBreakpointListener.class);
  myBreakpointManager.addBreakpointListener(new XBreakpointAdapter<XBreakpoint<?>>() {
    public void breakpointRemoved(@Nonnull final XBreakpoint<?> breakpoint) {
      XDependentBreakpointInfo info = mySlave2Info.remove(breakpoint);
      if (info != null) {
        myMaster2Info.remove(info.myMasterBreakpoint, info);
      }

      Collection<XDependentBreakpointInfo> infos = myMaster2Info.removeAll((XBreakpointBase)breakpoint);
      if (infos != null) {
        for (XDependentBreakpointInfo breakpointInfo : infos) {
          XDependentBreakpointInfo removed = mySlave2Info.remove(breakpointInfo.mySlaveBreakpoint);
          if (removed != null) {
            myDispatcher.getMulticaster().dependencyCleared(breakpointInfo.mySlaveBreakpoint);
          }
        }
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:XDependentBreakpointManager.java

示例12: getPublisher

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
@NotNull
@Override
public <T extends EventListener> T getPublisher(Class<T> listenerClass) {
  EventDispatcher<?> dispatcher = myDispatchers.get(listenerClass);
  if (dispatcher == null) {
    dispatcher = EventDispatcher.create(listenerClass);
    myDispatchers.put(listenerClass, dispatcher);
  }
  //noinspection unchecked
  return (T)dispatcher.getMulticaster();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JpsEventDispatcherBase.java

示例13: ArtifactImpl

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public ArtifactImpl(@NotNull String name, @NotNull ArtifactType artifactType, boolean buildOnMake, @NotNull CompositePackagingElement<?> rootElement,
                    String outputPath,
                    EventDispatcher<ArtifactListener> dispatcher) {
  myName = name;
  myArtifactType = artifactType;
  myBuildOnMake = buildOnMake;
  myRootElement = rootElement;
  myOutputPath = outputPath;
  myDispatcher = dispatcher;
  myProperties = new HashMap<ArtifactPropertiesProvider, ArtifactProperties<?>>();
  resetProperties();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ArtifactImpl.java

示例14: createCopy

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public ArtifactImpl createCopy(EventDispatcher<ArtifactListener> dispatcher) {
  final ArtifactImpl artifact = new ArtifactImpl(myName, myArtifactType, myBuildOnMake, myRootElement, myOutputPath, dispatcher);
  for (Map.Entry<ArtifactPropertiesProvider, ArtifactProperties<?>> entry : myProperties.entrySet()) {
    final ArtifactProperties newProperties = artifact.myProperties.get(entry.getKey());
    //noinspection unchecked
    newProperties.loadState(entry.getValue().getState());
  }
  return artifact;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ArtifactImpl.java

示例15: CheckboxTreeTable

import com.intellij.util.EventDispatcher; //导入依赖的package包/类
public CheckboxTreeTable(CheckedTreeNode root, CheckboxTree.CheckboxTreeCellRenderer renderer, final ColumnInfo[] columns) {
  super(new ListTreeTableModelOnColumns(root, columns));
  final TreeTableTree tree = getTree();
  myEventDispatcher = EventDispatcher.create(CheckboxTreeListener.class);
  CheckboxTreeHelper helper = new CheckboxTreeHelper(CheckboxTreeHelper.DEFAULT_POLICY, myEventDispatcher);
  helper.initTree(tree, this, renderer);
  tree.setSelectionRow(0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CheckboxTreeTable.java


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