[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: newbiew qn: how to add a viewer to the EMF editor plugin

Charles,

I didn't know javalobby had such a thing. It's more than enough to manage this newsgroup's traffic for me.

Somehow I think holding a write lock for minutes will not be a good thing. The UI would not be able to even read the model for this whole period of time so had better not even try. That's why my sense is that something that takes five minutes should produce no visible changes until it's done. Let the UI view an old plot until there is a new one and then switch it when its done.


Charles Martin wrote:
Hi Ed

   With regard to the EMF Transactional Editor...

If I want to process a long edit in an RCP, can I / should I use the EMF TransactionalEditingDomain.runExclusive() and the Eclipse Jobs API together?

  That is, should I use something like:

--------------------------------------------------
  final TransactionalEditingDomain domain = getDomain();
  final CommandStack stack = domain.getCommandStack();

Job job = new Job("My EMF Edit Job") {
protected IStatus run(IProgressMonitor monitor) {
domain.runExclusive(new RunnableWithResult.Impl() {
public void run() {


// notify (other) views // that EMF model is dirty
setDirty(true);


          // read data from disk
          Object[] data = readData();

// modify EMF model objects
Command cmd = domain.createCommand(
SetCommand.class, new CommandParameter(...));
stack.execute(cmd);


}
}
return Status.OK_STATUS;
}
};


job.schedule();


-------------------------------------------------- Thanks

  Charles


BTW, I would post some this basic EMF/RCP question on the new javalobby page but I am not sure where to post ? Do you know where the EMF forum went?