Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2009 Bestsolution.at and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html Contributors: Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
package org.eclipse.emf.example.databinding.project.ui.rcp.handlers;
import  org.eclipse.swt.widgets.Shell;
import  org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider;
import  org.eclipse.emf.examples.databinding.project.core.IModelResource;
import  org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;


Handles the editing of committers
  public Object execute(ExecutionEvent eventthrows ExecutionException
  {
    Shell shell = (Shell)ctx.getVariable(.);
    IModelResource resource = (IModelResource)ctx.getVariable(ResourceProvider.MODEL_RESOURCE_NAME);
    CommitterShip com = (CommitterShip)ctx.getVariable(ResourceProvider.COMMITTER_NAME);
    if (resource.setSavePoint().isOK())
    {
      CommitterShipDialog dialog = new CommitterShipDialog(shellresourcecomfalse);
      if (dialog.open() == .)
      {
        resource.commit();
      }
      else
      {
        resource.rollback();
      }
    }
    else
    {
      throw new ExecutionException("Could not create a save point");
    }
    return null;
  }
New to GrepCode? Check out our FAQ X