本文整理汇总了Java中org.eclipse.jface.text.IEditingSupportRegistry类的典型用法代码示例。如果您正苦于以下问题:Java IEditingSupportRegistry类的具体用法?Java IEditingSupportRegistry怎么用?Java IEditingSupportRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEditingSupportRegistry类属于org.eclipse.jface.text包,在下文中一共展示了IEditingSupportRegistry类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: linkedModeLeft
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
/**
* PopUp gets closed and the focus goes back to the editor. Linked mode stays active and can be reenabled, i.e. by
* putting the caret back into a linked editing position.
*/
public void linkedModeLeft() {
if (linkedModeModel != null) {
linkedModeModel.exit(ILinkedModeListener.NONE);
}
if (popup != null) {
popup.close();
}
if (editor != null) {
ISourceViewer viewer = editor.getInternalSourceViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry = (IEditingSupportRegistry) viewer;
registry.unregister(focusEditingSupport);
}
}
}
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:RenameLinkedMode.java
示例2: documentAboutToBeChanged
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
public void documentAboutToBeChanged(DocumentEvent event) {
// default behavior: any document change outside a linked position
// causes us to exit
int end = event.getOffset() + event.getLength();
for (int offset = event.getOffset(); offset <= end; offset++) {
if (!fModel.anyPositionContains(offset)) {
ITextViewer viewer = fCurrentTarget.getViewer();
if (fFramePosition != null && viewer instanceof IEditingSupportRegistry) {
IEditingSupport[] helpers = ((IEditingSupportRegistry) viewer).getRegisteredSupports();
for (int i = 0; i < helpers.length; i++) {
if (helpers[i].isOriginator(null,
new Region(fFramePosition.getOffset(), fFramePosition.getLength())))
return;
}
}
leave(ILinkedModeListener.EXTERNAL_MODIFICATION);
return;
}
}
// Make sure that any document change is done inside a compound
// change
beginCompoundChangeIfNeeded();
}
开发者ID:curiosag,项目名称:ftc,代码行数:28,代码来源:TweakedLinkedModeUI.java
示例3: start
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
public boolean start(IRenameElementContext renameElementContext, IProgressMonitor monitor) {
if (renameElementContext == null)
throw new IllegalArgumentException("RenameElementContext is null");
this.linkedPositionGroup = linkedPositionGroupCalculator.getLinkedPositionGroup(renameElementContext, monitor);
if (linkedPositionGroup == null || linkedPositionGroup.isEmpty())
return false;
this.editor = (XtextEditor) renameElementContext.getTriggeringEditor();
this.focusEditingSupport = new FocusEditingSupport();
ISourceViewer viewer = editor.getInternalSourceViewer();
IDocument document = viewer.getDocument();
originalSelection = viewer.getSelectedRange();
currentPosition = linkedPositionGroup.getPositions()[0];
originalName = getCurrentName();
try {
linkedModeModel = new LinkedModeModel();
linkedModeModel.addGroup(linkedPositionGroup);
linkedModeModel.forceInstall();
linkedModeModel.addLinkingListener(new EditorSynchronizer());
LinkedModeUI ui = new EditorLinkedModeUI(linkedModeModel, viewer);
ui.setExitPolicy(new ExitPolicy(document));
if (currentPosition.includes(originalSelection.x))
ui.setExitPosition(viewer, originalSelection.x, 0, Integer.MAX_VALUE);
ui.enter();
if (currentPosition.includes(originalSelection.x)
&& currentPosition.includes(originalSelection.x + originalSelection.y))
viewer.setSelectedRange(originalSelection.x, originalSelection.y);
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry = (IEditingSupportRegistry) viewer;
registry.register(focusEditingSupport);
}
openPopup();
return true;
} catch (BadLocationException e) {
throw new WrappedException(e);
}
}
开发者ID:cplutte,项目名称:bts,代码行数:37,代码来源:RenameLinkedMode.java
示例4: hide
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
/**
* Hides this popup.
*/
public void hide()
{
bufferString = "";
selectedProposal = null;
fLastKeyPressed = '\0';
unregister();
if (fViewer instanceof IEditingSupportRegistry)
{
IEditingSupportRegistry registry = (IEditingSupportRegistry) fViewer;
registry.unregister(fFocusHelper);
}
if (Helper.okToUse(fProposalShell))
{
fContentAssistant.removeContentAssistListener(this, ContentAssistant.PROPOSAL_SELECTOR);
// TISTUD-913: moved the 'fPopupCloser.uninstall();' to disposePopup()
if (fAdditionalInfoController != null)
{
fAdditionalInfoController.disposeInformationControl();
}
if (Helper.okToUse(fProposalTable))
{
fProposalTable.removeAll();
fProposalTable.update();
}
// TISTUD-1550: Call to dispose, instead of fProposalShell.setVisible(false);
fProposalShell.setVisible(false);
}
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:35,代码来源:CompletionProposalPopup.java
示例5: linkedModeLeft
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
private void linkedModeLeft() {
fgActiveLinkedMode= null;
if (fInfoPopup != null) {
fInfoPopup.close();
}
ISourceViewer viewer= fEditor.getViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry= (IEditingSupportRegistry) viewer;
registry.unregister(fFocusEditingSupport);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:RenameLinkedMode.java
示例6: registerHelper
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
private void registerHelper(IEditingSupport helper, JavaEditor editor) {
ISourceViewer viewer= editor.getViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry= (IEditingSupportRegistry) viewer;
registry.register(helper);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:OrganizeImportsAction.java
示例7: deregisterHelper
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
private void deregisterHelper(IEditingSupport helper, JavaEditor editor) {
ISourceViewer viewer= editor.getViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry= (IEditingSupportRegistry) viewer;
registry.unregister(helper);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:OrganizeImportsAction.java
示例8: registerHelper
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
private void registerHelper(IEditingSupport helper) {
ISourceViewer viewer= fEditor.getViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry= (IEditingSupportRegistry) viewer;
registry.register(helper);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:AddImportOnSelectionAction.java
示例9: deregisterHelper
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
private void deregisterHelper(IEditingSupport helper) {
ISourceViewer viewer= fEditor.getViewer();
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry= (IEditingSupportRegistry) viewer;
registry.unregister(helper);
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:AddImportOnSelectionAction.java
示例10: shellDeactivated
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
public void shellDeactivated(ShellEvent e) {
// TODO re-enable after debugging
// if (true) return;
// from LinkedPositionUI:
// don't deactivate on focus lost, since the proposal popups may
// take focus
// plus: it doesn't hurt if you can check with another window
// without losing linked mode
// since there is no intrusive popup sticking out.
// need to check first what happens on reentering based on an open
// action
// Seems to be no problem
// Better:
// Check with content assistant and only leave if its not the
// proposal shell that took the
// focus away.
StyledText text;
final ITextViewer viewer;
Display display;
if (fCurrentTarget == null || (text = fCurrentTarget.fWidget) == null || text.isDisposed()
|| (display = text.getDisplay()) == null || display.isDisposed()
|| (viewer = fCurrentTarget.getViewer()) == null) {
leave(ILinkedModeListener.EXIT_ALL);
} else {
// Post in UI thread since the assistant popup will only get the
// focus after we lose it.
display.asyncExec(new Runnable() {
public void run() {
if (fIsActive && viewer instanceof IEditingSupportRegistry) {
IEditingSupport[] helpers = ((IEditingSupportRegistry) viewer).getRegisteredSupports();
for (int i = 0; i < helpers.length; i++) {
if (helpers[i].ownsFocusShell())
return;
}
}
// else
leave(ILinkedModeListener.EXIT_ALL);
}
});
}
}
开发者ID:curiosag,项目名称:ftc,代码行数:50,代码来源:TweakedLinkedModeUI.java
示例11: start
import org.eclipse.jface.text.IEditingSupportRegistry; //导入依赖的package包/类
public void start() {
if (getActiveLinkedMode() != null) {
// for safety; should already be handled in RenameJavaElementAction
fgActiveLinkedMode.startFullDialog();
return;
}
ISourceViewer viewer = fEditor.getViewer();
IDocument document = viewer.getDocument();
ITypeScriptFile tsFile = fEditor.getTypeScriptFile();
tsFile.setDisableChanged(true);
fOriginalSelection = viewer.getSelectedRange();
int offset = fOriginalSelection.x;
try {
fLinkedPositionGroup = new LinkedPositionGroup();
if (viewer instanceof ITextViewerExtension6) {
IUndoManager undoManager = ((ITextViewerExtension6) viewer).getUndoManager();
if (undoManager instanceof IUndoManagerExtension) {
IUndoManagerExtension undoManagerExtension = (IUndoManagerExtension) undoManager;
IUndoContext undoContext = undoManagerExtension.getUndoContext();
IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory();
fStartingUndoOperation = operationHistory.getUndoOperation(undoContext);
}
}
// Find occurrences
List<OccurrencesResponseItem> occurrences = tsFile.occurrences(offset).get(1000, TimeUnit.MILLISECONDS);
// Create Eclipse linked position from the occurrences list.
int start, length;
for (int i = 0; i < occurrences.size(); i++) {
OccurrencesResponseItem item = occurrences.get(i);
start = tsFile.getPosition(item.getStart());
length = tsFile.getPosition(item.getEnd()) - start;
LinkedPosition linkedPosition = new LinkedPosition(document, start, length, i);
if (i == 0) {
fOriginalName = document.get(start, length);
fNamePosition = linkedPosition;
}
fLinkedPositionGroup.addPosition(linkedPosition);
}
fLinkedModeModel = new LinkedModeModel();
fLinkedModeModel.addGroup(fLinkedPositionGroup);
fLinkedModeModel.forceInstall();
fLinkedModeModel.addLinkingListener(new EditorHighlightingSynchronizer(fEditor));
fLinkedModeModel.addLinkingListener(new EditorSynchronizer());
LinkedModeUI ui = new EditorLinkedModeUI(fLinkedModeModel, viewer);
ui.setExitPosition(viewer, offset, 0, Integer.MAX_VALUE);
ui.setExitPolicy(new ExitPolicy(document));
ui.enter();
viewer.setSelectedRange(fOriginalSelection.x, fOriginalSelection.y); // by
// default,
// full
// word
// is
// selected;
// restore
// original
// selection
if (viewer instanceof IEditingSupportRegistry) {
IEditingSupportRegistry registry = (IEditingSupportRegistry) viewer;
registry.register(fFocusEditingSupport);
}
openSecondaryPopup();
// startAnimation();
fgActiveLinkedMode = this;
} catch (Exception e) {
JSDTTypeScriptUIPlugin.log(e);
}
}
开发者ID:angelozerr,项目名称:typescript.java,代码行数:79,代码来源:RenameLinkedMode.java
注:本文中的org.eclipse.jface.text.IEditingSupportRegistry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论