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


Java DeleteProvider.canDeleteElement方法代码示例

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


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

示例1: canDeleteElement

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
@Override
public boolean canDeleteElement(@NotNull DataContext dataContext)
{
	if(myEditor != null)
	{
		LwInspectionSuppression[] suppressions = dataContext.getData(LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY);
		if(suppressions != null)
		{
			return true;
		}
		DeleteProvider baseProvider = myEditor.getDataUnchecked(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
		if(baseProvider != null)
		{
			return baseProvider.canDeleteElement(dataContext);
		}
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:19,代码来源:ComponentTree.java

示例2: selectDelegate

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
@Nullable
private DeleteProvider selectDelegate(final DataContext dataContext) {
  for (DeleteProvider provider : myProviders) {
    if (provider.canDeleteElement(dataContext)) {
      return provider;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ShelvedChangesViewManager.java

示例3: canDeleteElement

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
public boolean canDeleteElement(@NotNull DataContext dataContext) {
  if (myEditor != null) {
    LwInspectionSuppression[] suppressions = LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY.getData(dataContext);
    if (suppressions != null) {
      return true;
    }
    DeleteProvider baseProvider = (DeleteProvider) myEditor.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER.getName());
    if (baseProvider != null) {
      return baseProvider.canDeleteElement(dataContext);
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ComponentTree.java

示例4: update

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
public void update(AnActionEvent event){
  String place = event.getPlace();
  Presentation presentation = event.getPresentation();
  if (ActionPlaces.PROJECT_VIEW_POPUP.equals(place) || ActionPlaces.COMMANDER_POPUP.equals(place))
    presentation.setText(IdeBundle.message("action.delete.ellipsis"));
  else
    presentation.setText(IdeBundle.message("action.delete"));
  DataContext dataContext = event.getDataContext();
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  DeleteProvider provider = getDeleteProvider(dataContext);
  if (event.getInputEvent() instanceof KeyEvent) {
    KeyEvent keyEvent = (KeyEvent)event.getInputEvent();
    Object component = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
    if (component instanceof JTextComponent) provider = null; // Do not override text deletion
    if (keyEvent.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
      // Do not override text deletion in speed search
      if (component instanceof JComponent) {
        SpeedSearchSupply searchSupply = SpeedSearchSupply.getSupply((JComponent)component);
        if (searchSupply != null) provider = null;
      }

      String activeSpeedSearchFilter = SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY.getData(dataContext);
      if (!StringUtil.isEmpty(activeSpeedSearchFilter)) {
        provider = null;
      }
    }
  }
  if (provider instanceof TitledHandler) {
    presentation.setText(((TitledHandler)provider).getActionTitle());
  }
  final boolean canDelete = provider != null && provider.canDeleteElement(dataContext);
  if (ActionPlaces.isPopupPlace(event.getPlace())) {
    presentation.setVisible(canDelete);
  }
  else {
    presentation.setEnabled(canDelete);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:DeleteAction.java

示例5: update

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
public void update(AnActionEvent event){
  String place = event.getPlace();
  Presentation presentation = event.getPresentation();
  if (ActionPlaces.PROJECT_VIEW_POPUP.equals(place) || ActionPlaces.COMMANDER_POPUP.equals(place))
    presentation.setText(IdeBundle.message("action.delete.ellipsis"));
  else
    presentation.setText(IdeBundle.message("action.delete"));
  DataContext dataContext = event.getDataContext();
  Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  DeleteProvider provider = getDeleteProvider(dataContext);
  if (event.getInputEvent() instanceof KeyEvent) {
    KeyEvent keyEvent = (KeyEvent)event.getInputEvent();
    Object component = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
    if (component instanceof JTextComponent) provider = null; // Do not override text deletion
    if (keyEvent.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
      // Do not override text deletion in speed search
      if (component instanceof JComponent) {
        SpeedSearchSupply searchSupply = SpeedSearchSupply.getSupply((JComponent)component);
        if (searchSupply != null) provider = null;
      }

      String activeSpeedSearchFilter = SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY.getData(dataContext);
      if (!StringUtil.isEmpty(activeSpeedSearchFilter)) {
        provider = null;
      }
    }
  }
  if (provider instanceof TitledHandler) {
    presentation.setText(((TitledHandler)provider).getActionTitle());
  }
  final boolean canDelete = provider != null && provider.canDeleteElement(dataContext);
  if (ActionPlaces.isPopupPlace(event.getPlace())) {
    presentation.setVisible(canDelete);
  }
  else {
    presentation.setEnabled(canDelete);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:DeleteAction.java

示例6: update

import com.intellij.ide.DeleteProvider; //导入方法依赖的package包/类
public void update(AnActionEvent event){
  String place = event.getPlace();
  Presentation presentation = event.getPresentation();
  if (ActionPlaces.PROJECT_VIEW_POPUP.equals(place) || ActionPlaces.COMMANDER_POPUP.equals(place))
    presentation.setText(IdeBundle.message("action.delete.ellipsis"));
  else
    presentation.setText(IdeBundle.message("action.delete"));
  DataContext dataContext = event.getDataContext();
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  DeleteProvider provider = getDeleteProvider(dataContext);
  if (event.getInputEvent() instanceof KeyEvent) {
    KeyEvent keyEvent = (KeyEvent)event.getInputEvent();
    Object component = event.getData(PlatformDataKeys.CONTEXT_COMPONENT);
    if (component instanceof JTextComponent) provider = null; // Do not override text deletion
    if (keyEvent.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
      // Do not override text deletion in speed search
      if (component instanceof JComponent) {
        SpeedSearchSupply searchSupply = SpeedSearchSupply.getSupply((JComponent)component);
        if (searchSupply != null) provider = null;
      }

      String activeSpeedSearchFilter = event.getData(SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY);
      if (!StringUtil.isEmpty(activeSpeedSearchFilter)) {
        provider = null;
      }
    }
  }
  if (provider instanceof TitledHandler) {
    presentation.setText(((TitledHandler)provider).getActionTitle());
  }
  final boolean canDelete = provider != null && provider.canDeleteElement(dataContext);
  if (ActionPlaces.isPopupPlace(event.getPlace())) {
    presentation.setVisible(canDelete);
  }
  else {
    presentation.setEnabled(canDelete);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:43,代码来源:DeleteAction.java


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