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


Java DiffContext.getProject方法代码示例

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


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

示例1: create

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
@Override
@NotNull
public TextEditorHolder create(@NotNull DiffContent content, @NotNull DiffContext context) {
  if (!(content instanceof DocumentContent)) throw new IllegalArgumentException(content.toString());
  Project project = context.getProject();
  DocumentContent documentContent = (DocumentContent)content;

  EditorEx editor = DiffUtil.createEditor(documentContent.getDocument(), project, false, true);
  DiffUtil.configureEditor(editor, documentContent, project);
  return new TextEditorHolder(editor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:TextEditorHolder.java

示例2: canShowContent

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
@Override
public boolean canShowContent(@NotNull DiffContent content, @NotNull DiffContext context) {
  if (content instanceof DocumentContent) return true;
  if (content instanceof FileContent) {
    Project project = context.getProject();
    if (project == null) project = ProjectManager.getInstance().getDefaultProject();
    VirtualFile file = ((FileContent)content).getFile();

    return FileEditorProviderManager.getInstance().getProviders(project, file).length != 0;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:BinaryEditorHolder.java

示例3: SimpleDiffPanel

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public SimpleDiffPanel(@NotNull JComponent editorPanel,
                       @NotNull DataProvider dataProvider,
                       @NotNull DiffContext context) {
  super(context.getProject(), dataProvider, context);
  JPanel centerPanel = JBUI.Panels.simplePanel(editorPanel).addToTop(myNotificationsPanel);

  myContentPanel.add(centerPanel, GOOD_CONTENT);
  myContentPanel.add(DiffUtil.createMessagePanel("Error"), ERROR_CONTENT);

  setCurrentCard(GOOD_CONTENT, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SimpleDiffPanel.java

示例4: SvnDiffViewer

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public SvnDiffViewer(@NotNull DiffContext context, @NotNull DiffRequest propertyRequest, @NotNull DiffViewer wrappingViewer) {
  myProject = context.getProject();
  myContext = context;
  myPropertyRequest = propertyRequest;
  myContentViewer = wrappingViewer;

  myPropertyRequest.onAssigned(true);

  mySettings = initSettings(context);

  mySplitter = new MySplitter("Property Changes");
  mySplitter.setProportion(mySettings.getSplitterProportion());
  mySplitter.setFirstComponent(myContentViewer.getComponent());

  myNotificationPanel = new Wrapper();

  MyPropertyContext propertyContext = initPropertyContext(context);
  myPropertiesViewer = createPropertiesViewer(propertyRequest, propertyContext);

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(mySplitter, BorderLayout.CENTER);
  myPanel.add(myNotificationPanel, BorderLayout.SOUTH);
  DataManager.registerDataProvider(myPanel, new DataProvider() {
    @Override
    public Object getData(@NonNls String dataId) {
      DataProvider propertiesDataProvider = DataManagerImpl.getDataProviderEx(myPropertiesViewer.getComponent());
      DataProvider contentDataProvider = DataManagerImpl.getDataProviderEx(myContentViewer.getComponent());
      DataProvider defaultDP = myPropertiesViewerFocused ? propertiesDataProvider : contentDataProvider;
      DataProvider fallbackDP = myPropertiesViewerFocused ? contentDataProvider : propertiesDataProvider;
      return DiffUtil.getData(defaultDP, fallbackDP, dataId);
    }
  });

  updatePropertiesPanel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:SvnDiffViewer.java

示例5: canShowContent

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
@Override
public boolean canShowContent(@Nonnull DiffContent content, @Nonnull DiffContext context) {
  if (content instanceof DocumentContent) return true;
  if (content instanceof FileContent) {
    Project project = context.getProject();
    if (project == null) project = ProjectManager.getInstance().getDefaultProject();
    VirtualFile file = ((FileContent)content).getFile();

    return FileEditorProviderManager.getInstance().getProviders(project, file).length != 0;
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:BinaryEditorHolder.java

示例6: SimpleDiffPanel

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public SimpleDiffPanel(@Nonnull JComponent editorPanel,
                       @Nonnull DataProvider dataProvider,
                       @Nonnull DiffContext context) {
  super(context.getProject(), dataProvider, context);
  JPanel centerPanel = JBUI.Panels.simplePanel(editorPanel).addToTop(myNotificationsPanel);

  myContentPanel.add(centerPanel, GOOD_CONTENT);
  myContentPanel.add(DiffUtil.createMessagePanel("Error"), ERROR_CONTENT);

  setCurrentCard(GOOD_CONTENT, false);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:SimpleDiffPanel.java

示例7: DiffViewerBase

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public DiffViewerBase(@NotNull DiffContext context, @NotNull ContentDiffRequest request) {
  myProject = context.getProject();
  myContext = context;
  myRequest = request;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DiffViewerBase.java

示例8: DirDiffViewer

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public DirDiffViewer(@NotNull DiffContext context, @NotNull ContentDiffRequest request) {
  myContext = context;
  myRequest = request;

  List<DiffContent> contents = request.getContents();
  DiffElement element1 = createDiffElement(contents.get(0));
  DiffElement element2 = createDiffElement(contents.get(1));

  Project project = context.getProject();
  if (project == null) project = DefaultProjectFactory.getInstance().getDefaultProject();

  DirDiffTableModel model = new DirDiffTableModel(project, element1, element2, new DirDiffSettings());

  myDirDiffPanel = new DirDiffPanel(model, new DirDiffWindow((DirDiffFrame)null) {
    @Override
    public Window getWindow() {
      return null;
    }

    @Override
    public Disposable getDisposable() {
      return DirDiffViewer.this;
    }

    @Override
    public void setTitle(String title) {
    }
  });

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(myDirDiffPanel.getPanel(), BorderLayout.CENTER);
  DataManager.registerDataProvider(myPanel, new DataProvider() {
    @Override
    public Object getData(@NonNls String dataId) {
      if (PlatformDataKeys.HELP_ID.is(dataId)) {
        return "reference.dialogs.diff.folder";
      }
      return myDirDiffPanel.getData(dataId);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:DirDiffViewer.java

示例9: DiffViewerBase

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public DiffViewerBase(@Nonnull DiffContext context, @Nonnull ContentDiffRequest request) {
  myProject = context.getProject();
  myContext = context;
  myRequest = request;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:DiffViewerBase.java

示例10: DirDiffViewer

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public DirDiffViewer(@Nonnull DiffContext context, @Nonnull ContentDiffRequest request) {
  myContext = context;
  myRequest = request;

  List<DiffContent> contents = request.getContents();
  DiffElement element1 = createDiffElement(contents.get(0));
  DiffElement element2 = createDiffElement(contents.get(1));

  Project project = context.getProject();
  if (project == null) project = DefaultProjectFactory.getInstance().getDefaultProject();

  DirDiffTableModel model = new DirDiffTableModel(project, element1, element2, new DirDiffSettings());

  myDirDiffPanel = new DirDiffPanel(model, new DirDiffWindow((DirDiffFrame)null) {
    @Override
    public Window getWindow() {
      return null;
    }

    @Override
    public Disposable getDisposable() {
      return DirDiffViewer.this;
    }

    @Override
    public void setTitle(String title) {
    }
  });

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(myDirDiffPanel.getPanel(), BorderLayout.CENTER);
  DataManager.registerDataProvider(myPanel, new DataProvider() {
    @Override
    public Object getData(@Nonnull @NonNls Key dataId) {
      if (PlatformDataKeys.HELP_ID == dataId) {
        return "reference.dialogs.diff.folder";
      }
      return myDirDiffPanel.getData(dataId);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:42,代码来源:DirDiffViewer.java

示例11: ApplyPatchViewer

import com.intellij.diff.DiffContext; //导入方法依赖的package包/类
public ApplyPatchViewer(@Nonnull DiffContext context, @Nonnull ApplyPatchRequest request) {
  myProject = context.getProject();
  myContext = context;
  myPatchRequest = request;


  DocumentContent resultContent = request.getResultContent();
  DocumentContent patchContent = DiffContentFactory.getInstance().create(new DocumentImpl("", true), resultContent);

  myResultHolder = TextEditorHolder.create(myProject, resultContent);
  myPatchHolder = TextEditorHolder.create(myProject, patchContent);

  myResultEditor = myResultHolder.getEditor();
  myPatchEditor = myPatchHolder.getEditor();

  if (isReadOnly()) myResultEditor.setViewer(true);
  myPatchEditor.setViewer(true);

  DiffUtil.disableBlitting(myResultEditor);
  DiffUtil.disableBlitting(myPatchEditor);

  ((EditorMarkupModel)myResultEditor.getMarkupModel()).setErrorStripeVisible(false);
  myResultEditor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);

  myPatchEditor.getGutterComponentEx().setForceShowRightFreePaintersArea(true);
  ((EditorMarkupModel)myPatchEditor.getMarkupModel()).setErrorStripeVisible(false);


  List<TextEditorHolder> holders = ContainerUtil.list(myResultHolder, myPatchHolder);
  List<EditorEx> editors = ContainerUtil.list(myResultEditor, myPatchEditor);
  JComponent resultTitle = DiffUtil.createTitle(myPatchRequest.getResultTitle());
  JComponent patchTitle = DiffUtil.createTitle(myPatchRequest.getPatchTitle());
  List<JComponent> titleComponents = DiffUtil.createSyncHeightComponents(ContainerUtil.list(resultTitle, patchTitle));

  myContentPanel = new TwosideContentPanel(holders, titleComponents);
  myPanel = new SimpleDiffPanel(myContentPanel, this, myContext);

  myModel = new MyModel(myProject, myResultEditor.getDocument());

  myFocusTrackerSupport = new FocusTrackerSupport.Twoside(holders);
  myFocusTrackerSupport.setCurrentSide(Side.LEFT);
  myPrevNextDifferenceIterable = new MyPrevNextDifferenceIterable();
  myStatusPanel = new MyStatusPanel();
  myFoldingModel = new MyFoldingModel(myResultEditor, this);


  new MyFocusOppositePaneAction().install(myPanel);
  new TextDiffViewerUtil.EditorActionsPopup(createEditorPopupActions()).install(editors);

  new TextDiffViewerUtil.EditorFontSizeSynchronizer(editors).install(this);

  myEditorSettingsAction = new SetEditorSettingsAction(getTextSettings(), editors);
  myEditorSettingsAction.applyDefaults();

  if (!isReadOnly()) {
    DiffUtil.registerAction(new ApplySelectedChangesAction(true), myPanel);
    DiffUtil.registerAction(new IgnoreSelectedChangesAction(true), myPanel);
  }

  ProxyUndoRedoAction.register(myProject, myResultEditor, myContentPanel);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:62,代码来源:ApplyPatchViewer.java


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