• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeleteProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: deleteElement

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


示例2: 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


示例3: actionPerformed

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  DeleteProvider provider = getDeleteProvider(dataContext);
  if (provider == null) return;
  try {
    provider.deleteElement(dataContext);
  }
  catch (Throwable t) {
    if (t instanceof StackOverflowError){
      t.printStackTrace();
    }
    LOG.error(t);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DeleteAction.java


示例4: 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


示例5: actionPerformed

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
    @Override
    public void run() {
      DeleteProvider deleteProvider = e.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
      if (deleteProvider == null) return;
      deleteProvider.deleteElement(e.getDataContext());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DeleteUnversionedFilesAction.java


示例6: 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


示例7: deleteElement

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


示例8: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
protected DeleteProvider getDeleteProvider(DataContext dataContext) {
  return new VirtualFileDeleteProvider();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileDeleteAction.java


示例9: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
@Nullable
protected DeleteProvider getDeleteProvider(DataContext dataContext) {
  return PlatformDataKeys.DELETE_ELEMENT_PROVIDER.getData(dataContext);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DeleteAction.java


示例10: 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


示例11: deleteElement

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
public void deleteElement(@NotNull DataContext dataContext) {
  final DeleteProvider delegate = selectDelegate(dataContext);
  if (delegate != null) {
    delegate.deleteElement(dataContext);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ShelvedChangesViewManager.java


示例12: update

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  DeleteProvider deleteProvider = e.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
  e.getPresentation().setVisible(deleteProvider != null && deleteProvider.canDeleteElement(e.getDataContext()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DeleteUnversionedFilesAction.java


示例13: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
@Override
public DeleteProvider getDeleteProvider() {
  return myDelegate.getDeleteProvider();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:EditorWindowImpl.java


示例14: 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


示例15: actionPerformed

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DeleteProvider deleteProvider = e.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
  if (deleteProvider == null) return;
  deleteProvider.deleteElement(e.getDataContext());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:DeleteUnversionedFilesAction.java


示例16: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
@Nullable
protected DeleteProvider getDeleteProvider() {
  return null;
}
 
开发者ID:consulo,项目名称:consulo-javaee,代码行数:5,代码来源:JamNodeDescriptor.java


示例17: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
@Nullable
protected DeleteProvider getDeleteProvider(DataContext dataContext) {
  return dataContext.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:DeleteAction.java


示例18: 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


示例19: deleteElement

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
public void deleteElement(@Nonnull DataContext dataContext) {
  final DeleteProvider delegate = selectDelegate(dataContext);
  if (delegate != null) {
    delegate.deleteElement(dataContext);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:ShelvedChangesViewManager.java


示例20: getDeleteProvider

import com.intellij.ide.DeleteProvider; //导入依赖的package包/类
DeleteProvider getDeleteProvider(); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:EditorEx.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParameterValue类代码示例发布时间:2022-05-22
下一篇:
Java TranscodeException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap