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

Java VisibleAreaListener类代码示例

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

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



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

示例1: ScrollingModelImpl

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public ScrollingModelImpl(EditorImpl editor) {
  myEditor = editor;

  myEditor.getScrollPane().getViewport().addChangeListener(new ChangeListener() {
    private Rectangle myLastViewRect;

    @Override
    public void stateChanged(ChangeEvent event) {
      Rectangle viewRect = getVisibleArea();
      VisibleAreaEvent visibleAreaEvent = new VisibleAreaEvent(myEditor, myLastViewRect, viewRect);
      if (!myViewportPositioned && viewRect.height > 0) {
        myViewportPositioned = true;
        if (adjustVerticalOffsetIfNecessary()) {
          return;
        }
      }
      myLastViewRect = viewRect;
      for (VisibleAreaListener listener : myVisibleAreaListeners) {
        listener.visibleAreaChanged(visibleAreaEvent);
      }
    }
  });

  myDocumentListener = new DocumentAdapter() {
    @Override
    public void beforeDocumentChange(DocumentEvent e) {
      cancelAnimatedScrolling(true);
    }
  };
  myEditor.getDocument().addDocumentListener(myDocumentListener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ScrollingModelImpl.java


示例2: initListenerIfNecessary

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
private void initListenerIfNecessary() {
  // We can't attach the listener during this object initialization because there is a big chance that the editor is in incomplete
  // state there (e.g. it's scrolling model is not initialized yet).
  if (myVisualAreaListenerAttached) {
    return;
  }
  myVisualAreaListenerAttached = true;
  myEditor.getScrollingModel().addVisibleAreaListener(new VisibleAreaListener() {
    @Override
    public void visibleAreaChanged(VisibleAreaEvent e) {
      updateLastTopLeftCornerOffset();
    }
  });
  updateLastTopLeftCornerOffset();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SoftWrapApplianceManager.java


示例3: reflectivelyCheckCurrentListeners

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
private static void reflectivelyCheckCurrentListeners(String logLabel, Editor editor) {
  // Works in developement. Not in prod.
  try {
    if (editor.getScrollingModel().getClass().equals(ScrollingModelImpl.class)) {
      List<VisibleAreaListener> listeners =
          ReflectionUtil.getField(ScrollingModelImpl.class, editor.getScrollingModel(),
              List.class, "myVisibleAreaListeners");
      logger.info(logLabel + ": editor=" + shortObjectString(editor)
          + " currentListeners=" + listShortObjects(listeners));
    }
  } catch (Exception e) {
    logger.error("reflectivelyCheckCurrentListeners: error trying.", e);
  }
}
 
开发者ID:jawspeak,项目名称:intellij-joined-tab-scrolling,代码行数:15,代码来源:JoinedScroller.java


示例4: stateChanged

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void stateChanged(ChangeEvent event) {
  Rectangle viewRect = getVisibleArea();
  VisibleAreaEvent visibleAreaEvent = new VisibleAreaEvent(myEditor, myLastViewRect, viewRect);
  if (!myViewportPositioned && viewRect.height > 0) {
    myViewportPositioned = true;
    if (adjustVerticalOffsetIfNecessary()) {
      return;
    }
  }
  myLastViewRect = viewRect;
  for (VisibleAreaListener listener : myVisibleAreaListeners) {
    listener.visibleAreaChanged(visibleAreaEvent);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:ScrollingModelImpl.java


示例5: getVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public VisibleAreaListener getVisibleAreaListener() {
  return myVisibleAreaListener;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DiffSplitter.java


示例6: getVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public VisibleAreaListener getVisibleAreaListener() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:HorizontalDiffSplitter.java


示例7: DiffPanelImpl

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public DiffPanelImpl(final Window owner,
                     @NotNull Project project,
                     boolean enableToolbar,
                     boolean horizontal,
                     int diffDividerPolygonsOffset,
                     DiffTool parentTool) {
  myProject = project;
  myIsHorizontal = horizontal;
  myParentTool = parentTool;
  myOptions = new DiffPanelOptions(this);
  myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
  myPanel.disableToolbar(!enableToolbar);
  if (enableToolbar) myPanel.resetToolbar();
  myOwnerWindow = owner;
  myIsSyncScroll = true;
  final boolean v = !horizontal;
  myLeftSide =  new DiffSideView(this, new CustomLineBorder(1, 0, v ? 0 : 1, v ? 0 : 1));
  myRightSide = new DiffSideView(this, new CustomLineBorder(v ? 0 : 1, v ? 0 : 1, 1, 0));
  myLeftSide.becomeMaster();
  myDiffUpdater = new Rediffers(this);

  myDiffDividerPolygonsOffset = diffDividerPolygonsOffset;

  myData = createDiffPanelState(this);

  if (horizontal) {
    mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
                                  new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
  }
  else {
    mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
  }

  myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
  myDataProvider = new MyGenericDataProvider(this);
  myPanel.setDataProvider(myDataProvider);

  ComparisonPolicy comparisonPolicy = getComparisonPolicy();
  if (comparisonPolicy != DiffManagerImpl.getInstanceEx().getComparisonPolicy()) {
    setComparisonPolicy(comparisonPolicy);
  }

  HighlightMode highlightMode = getHighlightMode();
  if (highlightMode != DiffManagerImpl.getInstanceEx().getHighlightMode()) {
    setHighlightMode(highlightMode);
  }

  myVisibleAreaListener = new VisibleAreaListener() {
    @Override
    public void visibleAreaChanged(VisibleAreaEvent e) {
      Editor editor1 = getEditor1();
      if (editor1 != null) {
        editor1.getComponent().repaint();
      }
      Editor editor2 = getEditor2();
      if (editor2 != null) {
        editor2.getComponent().repaint();
      }
    }
  };
  registerActions();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:63,代码来源:DiffPanelImpl.java


示例8: onContentChangedIn

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public void onContentChangedIn(EditorSource source) {
  myDiffUpdater.contentRemoved(source);
  final EditorEx editor = source.getEditor();
  if (myIsHorizontal && source.getSide() == FragmentSide.SIDE1 && editor != null) {
    editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
  }
  DiffSideView viewSide = getSideView(source.getSide());
  viewSide.setEditorSource(getProject(), source);
  Disposer.dispose(myScrollSupport);
  if (editor == null) {
    if (!myDisposed) {
      rediff();
    }
    return;
  }

  final MouseListener mouseListener = PopupHandler
    .installUnknownPopupHandler(editor.getContentComponent(), new MergeActionGroup(this, source.getSide()), ActionManager.getInstance());
  myDiffUpdater.contentAdded(source);
  editor.getSettings().setLineNumbersShown(true);
  editor.getSettings().setFoldingOutlineShown(false);
  editor.getFoldingModel().setFoldingEnabled(false);
  ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);

  Editor editor1 = getEditor(FragmentSide.SIDE1);
  Editor editor2 = getEditor(FragmentSide.SIDE2);
  if (editor1 != null && editor2 != null && myIsSyncScroll) {
    myScrollSupport.install(new EditingSides[]{this});
  }

  final VisibleAreaListener visibleAreaListener = mySplitter.getVisibleAreaListener();
  final ScrollingModel scrollingModel = editor.getScrollingModel();
  if (visibleAreaListener != null) {
    scrollingModel.addVisibleAreaListener(visibleAreaListener);
    scrollingModel.addVisibleAreaListener(myVisibleAreaListener);
  }
  myFontSizeSynchronizer.synchronize(editor);
  source.addDisposable(new Disposable() {
    public void dispose() {
      myFontSizeSynchronizer.stopSynchronize(editor);
    }
  });
  source.addDisposable(new Disposable() {
    public void dispose() {
      if (visibleAreaListener != null) {
        scrollingModel.removeVisibleAreaListener(visibleAreaListener);
        scrollingModel.removeVisibleAreaListener(myVisibleAreaListener);
      }
      editor.getContentComponent().removeMouseListener(mouseListener);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:53,代码来源:DiffPanelImpl.java


示例9: addVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void addVisibleAreaListener(@NotNull final VisibleAreaListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TextComponentScrollingModel.java


示例10: removeVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void removeVisibleAreaListener(@NotNull final VisibleAreaListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TextComponentScrollingModel.java


示例11: addVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void addVisibleAreaListener(@NotNull VisibleAreaListener listener) {
  myVisibleAreaListeners.add(listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ScrollingModelImpl.java


示例12: removeVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void removeVisibleAreaListener(@NotNull VisibleAreaListener listener) {
  boolean success = myVisibleAreaListeners.remove(listener);
  LOG.assertTrue(success);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ScrollingModelImpl.java


示例13: DiffPanelImpl

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public DiffPanelImpl(final Window owner,
                     Project project,
                     boolean enableToolbar,
                     boolean horizontal,
                     int diffDividerPolygonsOffset,
                     DiffTool parentTool) {
  myProject = project;
  myIsHorizontal = horizontal;
  myParentTool = parentTool;
  myOptions = new DiffPanelOptions(this);
  myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
  myPanel.disableToolbar(!enableToolbar);
  if (enableToolbar) myPanel.resetToolbar();
  myOwnerWindow = owner;
  myIsSyncScroll = true;
  final boolean v = !horizontal;
  myLeftSide =  new DiffSideView(this, new CustomLineBorder(UIUtil.getBorderColor(), 1, 0, v ? 0 : 1, v ? 0 : 1));
  myRightSide = new DiffSideView(this, new CustomLineBorder(UIUtil.getBorderColor(), v ? 0 : 1, v ? 0 : 1, 1, 0));
  myLeftSide.becomeMaster();
  myDiffUpdater = new Rediffers(this);

  myData = createDiffPanelState(this);

  if (horizontal) {
    mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
                                  new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
  }
  else {
    mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
  }

  myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
  myDataProvider = new MyGenericDataProvider(this);
  myPanel.setDataProvider(myDataProvider);

  final ComparisonPolicy comparisonPolicy = getComparisonPolicy();
  final ComparisonPolicy defaultComparisonPolicy = DiffManagerImpl.getInstanceEx().getComparisonPolicy();

  if (defaultComparisonPolicy != null && comparisonPolicy != defaultComparisonPolicy) {
    setComparisonPolicy(defaultComparisonPolicy);
  }
  myVisibleAreaListener = new VisibleAreaListener() {
    @Override
    public void visibleAreaChanged(VisibleAreaEvent e) {
      Editor editor1 = getEditor1();
      if (editor1 != null) {
        editor1.getComponent().repaint();
      }
      Editor editor2 = getEditor2();
      if (editor2 != null) {
        editor2.getComponent().repaint();
      }
    }
  };
  registerActions();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:57,代码来源:DiffPanelImpl.java


示例14: addVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void addVisibleAreaListener(final VisibleAreaListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:TextComponentScrollingModel.java


示例15: removeVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void removeVisibleAreaListener(final VisibleAreaListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:TextComponentScrollingModel.java


示例16: addVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void addVisibleAreaListener(VisibleAreaListener listener) {
  myVisibleAreaListeners.add(listener);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:ScrollingModelImpl.java


示例17: removeVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void removeVisibleAreaListener(VisibleAreaListener listener) {
  boolean success = myVisibleAreaListeners.remove(listener);
  LOG.assertTrue(success);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ScrollingModelImpl.java


示例18: DiffPanelImpl

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public DiffPanelImpl(final Window owner, @Nonnull Project project, boolean enableToolbar, boolean horizontal, int diffDividerPolygonsOffset, DiffTool parentTool) {
  myProject = project;
  myIsHorizontal = horizontal;
  myParentTool = parentTool;
  myOptions = new DiffPanelOptions(this);
  myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
  myPanel.disableToolbar(!enableToolbar);
  if (enableToolbar) myPanel.resetToolbar();
  myOwnerWindow = owner;
  myIsSyncScroll = true;
  final boolean v = !horizontal;
  myLeftSide = new DiffSideView(this, new CustomLineBorder(1, 0, v ? 0 : 1, v ? 0 : 1));
  myRightSide = new DiffSideView(this, new CustomLineBorder(v ? 0 : 1, v ? 0 : 1, 1, 0));
  myLeftSide.becomeMaster();
  myDiffUpdater = new Rediffers(this);

  myDiffDividerPolygonsOffset = diffDividerPolygonsOffset;

  myData = createDiffPanelState(this);

  if (horizontal) {
    mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(), new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
  }
  else {
    mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
  }

  myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
  myDataProvider = new MyGenericDataProvider(this);
  myPanel.setDataProvider(myDataProvider);

  final ComparisonPolicy comparisonPolicy = getComparisonPolicy();
  final ComparisonPolicy defaultComparisonPolicy = DiffManagerImpl.getInstanceEx().getComparisonPolicy();
  final HighlightMode highlightMode = getHighlightMode();
  final HighlightMode defaultHighlightMode = DiffManagerImpl.getInstanceEx().getHighlightMode();

  if (defaultComparisonPolicy != null && comparisonPolicy != defaultComparisonPolicy) {
    setComparisonPolicy(defaultComparisonPolicy);
  }
  if (defaultHighlightMode != null && highlightMode != defaultHighlightMode) {
    setHighlightMode(defaultHighlightMode);
  }
  myVisibleAreaListener = new VisibleAreaListener() {
    @Override
    public void visibleAreaChanged(VisibleAreaEvent e) {
      Editor editor1 = getEditor1();
      if (editor1 != null) {
        editor1.getComponent().repaint();
      }
      Editor editor2 = getEditor2();
      if (editor2 != null) {
        editor2.getComponent().repaint();
      }
    }
  };
  registerActions();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:58,代码来源:DiffPanelImpl.java


示例19: onContentChangedIn

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
public void onContentChangedIn(EditorSource source) {
  myDiffUpdater.contentRemoved(source);
  final EditorEx editor = source.getEditor();
  if (myIsHorizontal && source.getSide() == FragmentSide.SIDE1 && editor != null) {
    editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
  }
  DiffSideView viewSide = getSideView(source.getSide());
  viewSide.setEditorSource(getProject(), source);
  Disposer.dispose(myScrollSupport);
  if (editor == null) {
    if (!myDisposed) {
      rediff();
    }
    return;
  }

  final MouseListener mouseListener = PopupHandler.installUnknownPopupHandler(editor.getContentComponent(), new MergeActionGroup(this, source.getSide()), ActionManager.getInstance());
  myDiffUpdater.contentAdded(source);
  editor.getSettings().setLineNumbersShown(true);
  editor.getSettings().setFoldingOutlineShown(false);
  editor.getFoldingModel().setFoldingEnabled(false);
  ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);

  Editor editor1 = getEditor(FragmentSide.SIDE1);
  Editor editor2 = getEditor(FragmentSide.SIDE2);
  if (editor1 != null && editor2 != null && myIsSyncScroll) {
    myScrollSupport.install(new EditingSides[]{this});
  }

  final VisibleAreaListener visibleAreaListener = mySplitter.getVisibleAreaListener();
  final ScrollingModel scrollingModel = editor.getScrollingModel();
  if (visibleAreaListener != null) {
    scrollingModel.addVisibleAreaListener(visibleAreaListener);
    scrollingModel.addVisibleAreaListener(myVisibleAreaListener);
  }
  myFontSizeSynchronizer.synchronize(editor);
  source.addDisposable(new Disposable() {
    public void dispose() {
      myFontSizeSynchronizer.stopSynchronize(editor);
    }
  });
  source.addDisposable(new Disposable() {
    public void dispose() {
      if (visibleAreaListener != null) {
        scrollingModel.removeVisibleAreaListener(visibleAreaListener);
        scrollingModel.removeVisibleAreaListener(myVisibleAreaListener);
      }
      editor.getContentComponent().removeMouseListener(mouseListener);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:52,代码来源:DiffPanelImpl.java


示例20: addVisibleAreaListener

import com.intellij.openapi.editor.event.VisibleAreaListener; //导入依赖的package包/类
@Override
public void addVisibleAreaListener(@Nonnull final VisibleAreaListener listener) {
  throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:TextComponentScrollingModel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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