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


Java IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP属性代码示例

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


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

示例1: isValid

public RefactoringStatus isValid(boolean needsSaving, boolean resilientForDerived)
    throws CoreException {
  RefactoringStatus result = super.isValid(needsSaving, resilientForDerived);
  if (result.hasFatalError()) return result;
  ModificationStamp currentStamp = getModificationStamp();
  // we don't need to check the kind here since the document stamp
  // and file stamp are in sync for documents implementing
  // IDocumentExtension4. If both are file stamps the file must
  // not be dirty
  if (fModificationStamp.getValue() != currentStamp.getValue()
      // we know here that the stamp value are equal. However, if
      // the stamp is a null stamp then the king must be equal as well.
      || (fModificationStamp.isFileStamp()
          && fModificationStamp.getValue() == IResource.NULL_STAMP
          && !currentStamp.isFileStamp())
      || (fModificationStamp.isDocumentStamp()
          && fModificationStamp.getValue() == IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP
          && !currentStamp.isDocumentStamp())
      || (fModificationStamp.isFileStamp() && currentStamp.isFileStamp() && isDirty(fFile))) {
    result.addFatalError(
        Messages.format(
            RefactoringCoreMessages.TextChanges_error_content_changed,
            BasicElementLabels.getPathLabel(fFile.getFullPath(), false)));
  }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:BufferValidationState.java

示例2: checkModificationStamp

public void checkModificationStamp(RefactoringStatus status, long stampToMatch) {
  if (fKind == DOCUMENT) {
    if (stampToMatch != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP
        && fModificationStamp != stampToMatch) {
      status.addFatalError(
          Messages.format(
              RefactoringCoreMessages.ResourceChange_error_has_been_modified,
              BasicElementLabels.getPathLabel(fResource.getFullPath(), false)));
    }
  } else {
    if (stampToMatch != IResource.NULL_STAMP && fModificationStamp != stampToMatch) {
      status.addFatalError(
          Messages.format(
              RefactoringCoreMessages.ResourceChange_error_has_been_modified,
              BasicElementLabels.getPathLabel(fResource.getFullPath(), false)));
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:ResourceChange.java

示例3: performEdit

private void performEdit(IDocument document, long oldFileValue, LinkedList<UndoEdit> editCollector, long[] oldDocValue, boolean[] setContentStampSuccess) throws MalformedTreeException, BadLocationException, CoreException {
	if (document instanceof IDocumentExtension4) {
		oldDocValue[0]= ((IDocumentExtension4)document).getModificationStamp();
	} else {
		oldDocValue[0]= oldFileValue;
	}

	// perform the changes
	for (int index= 0; index < fUndos.length; index++) {
		UndoEdit edit= fUndos[index];
		UndoEdit redo= edit.apply(document, TextEdit.CREATE_UNDO);
		editCollector.addFirst(redo);
	}

	if (document instanceof IDocumentExtension4 && fDocumentStamp != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP) {
		try {
			((IDocumentExtension4)document).replace(0, 0, "", fDocumentStamp); //$NON-NLS-1$
			setContentStampSuccess[0]= true;
		} catch (BadLocationException e) {
			throw wrapBadLocationException(e);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:CleanUpPostSaveListener.java

示例4: removeOccurrenceAnnotations

void removeOccurrenceAnnotations() {
	fMarkOccurrenceModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
	fMarkOccurrenceTargetRegion= null;

	IDocumentProvider documentProvider= getDocumentProvider();
	if (documentProvider == null)
		return;

	IAnnotationModel annotationModel= documentProvider.getAnnotationModel(getEditorInput());
	if (annotationModel == null || fOccurrenceAnnotations == null)
		return;

	synchronized (getLockObject(annotationModel)) {
		if (annotationModel instanceof IAnnotationModelExtension) {
			((IAnnotationModelExtension)annotationModel).replaceAnnotations(fOccurrenceAnnotations, null);
		} else {
			for (int i= 0, length= fOccurrenceAnnotations.length; i < length; i++)
				annotationModel.removeAnnotation(fOccurrenceAnnotations[i]);
		}
		fOccurrenceAnnotations= null;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:JavaEditor.java

示例5: UnchangedElementListener

public UnchangedElementListener(ElementInfo element) {
	this.element = element;
	if (element.fDocument instanceof IDocumentExtension4) {
		modificationStamp = ((IDocumentExtension4) element.fDocument).getModificationStamp();
	} else {
		modificationStamp = IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
	}

}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:XtextDocumentProvider.java

示例6: doSetInput

@Override
protected void doSetInput(IEditorInput input) throws CoreException
{
	synchronized (modificationStampLock)
	{
		// Reset our cache when a new input is set.
		lastModificationStamp = IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
		lastAstForModificationStamp = null;

	}
	super.doSetInput(input);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:12,代码来源:AbstractThemeableEditor.java

示例7: getParseResult

public ParseResult getParseResult()
{
	try
	{
		IDocument document = getDocument();
		if (document == null)
		{
			return null;
		}
		long modificationStamp = IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
		if (document instanceof IDocumentExtension4)
		{
			synchronized (modificationStampLock)
			{
				IDocumentExtension4 iDocumentExtension = (IDocumentExtension4) document;
				modificationStamp = iDocumentExtension.getModificationStamp();
				if (modificationStamp != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP
						&& modificationStamp == lastModificationStamp)
				{
					return lastAstForModificationStamp;
				}
			}
		}
		// Don't synchronize the actual parse!
		ParseResult ast = doGetAST(document);

		synchronized (modificationStampLock)
		{
			lastAstForModificationStamp = ast;
			lastModificationStamp = modificationStamp;
			return lastAstForModificationStamp;
		}
	}
	catch (Throwable e)
	{
		IdeLog.logTrace(CommonEditorPlugin.getDefault(), e.getMessage(), e, IDebugScopes.AST);
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:39,代码来源:AbstractThemeableEditor.java

示例8: checkModificationStamp

public void checkModificationStamp(RefactoringStatus status, long stampToMatch) {
    if (fKind == DOCUMENT) {
        if (stampToMatch != IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP
                && fModificationStamp != stampToMatch) {
            status.addFatalError(StringUtils.format("Resource %s has modifications", fResource.getFullPath()));
        }
    } else {
        if (stampToMatch != IResource.NULL_STAMP && fModificationStamp != stampToMatch) {
            status.addFatalError(StringUtils.format("Resource %s has modifications", fResource.getFullPath()));

        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:13,代码来源:PyChange.java

示例9: getModificationStamp

public long getModificationStamp() {
  IFileInfo info = fFileStore.fetchInfo();
  return info.exists() ? info.getLastModified() : IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:AbstractFileBuffer.java


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