Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Eclipse Refactoring-Plugin issues ...
Eclipse Refactoring-Plugin issues ... [message #463350] Thu, 08 February 2007 13:22 Go to next message
Eclipse UserFriend
Originally posted by: dpenalba.codicesoftware.com

Hello:

We are developing an Eclipse plugin for PlasticSCM. PlasticSCM is a new
SCM system, like CVS, Subversion, ClearCase, etc ... More info
in(http://www.codicesoftware.com)

We have the following problems managing IFileModificationValidator when
doing a refactor with org.eclipse.ltk.internal.core.refactoring plug-in. I
will try to explain the problem in a short manner.

Our checked-in files, are in a readOnly status. When we checkout a file to
modify it, readOnly property is removed.
When we do a refactor, our IFileModificationValidator is called and it
checkouts all needed files. But there is a problem with readOnly
properties. Look at this code, extracted from
org.eclipse.ltk.internal.core.refactoring.TextFileChange class.

01 public RefactoringStatus isValid(IProgressMonitor pm) throws
CoreException {
02 pm.beginTask("", 1); //$NON-NLS-1$
03 ITextFileBuffer buffer=
FileBuffers.getTextFileBufferManager().getTextFileBuffer(fFi le.getFullPath());
04 fDirty= buffer != null && buffer.isDirty();
05 RefactoringStatus result= fValidationState.isValid(needsSaving());
06 if (needsSaving()) {
07 result.merge(Changes.validateModifiesFiles(new IFile[]
{fFile}));
08 } else {
09 // we are reading the file. So it should be at least in sync
10 result.merge(Changes.checkInSync(new IFile[] {fFile}));
11 }
12 pm.worked(1);
13 return result;
14 }

When this code is invoked for a checked-in file (before a call to our
IFileModificationValidator), at line 05, the
fValidationState.isValid(needsSaving()) call returns a fatal error because
the involved resource is readOnly. Then, at line 07, this code call our
IFileModification validator, where the resource is chekced out, and set to
nonReadOnly. But is too late, because the fatal error produced on line 05,
make that all process be aborted.

The problem would be solved, if lines 05 and 07 are called in reverse
order. If first call to Changes.validateModifiesFiles(new IFile[]
{fFile}), this code will call our IFileModificationValidator code, so the
readOnly property will be removed, and then the
fValidationState.isValid(needsSaving()) will not fail.

Somebody can help me with this problem?

Thanks for all, and king regards
Re: Eclipse Refactoring-Plugin issues ... [message #463374 is a reply to message #463350] Fri, 09 February 2007 05:30 Go to previous messageGo to next message
Eclipse UserFriend
Somebody can give me an email of a person whom develops in this scope?

"Daniel "Pe
Re: Eclipse Refactoring-Plugin issues ... [message #463478 is a reply to message #463374] Mon, 12 February 2007 10:43 Go to previous message
Eclipse UserFriend
Is this newsgroup adapted for my question?

"Daniel" <dpenalba@codicesoftware.com> escribi
Previous Topic:Extensions and multi plug-in RCP app
Next Topic:Updating non-java code via Update Manager: Possible?
Goto Forum:
  


Current Time: Thu Mar 27 03:27:58 EDT 2025

Powered by FUDForum. Page generated in 0.02728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top