|
From: Mikael P. <er...@us...> - 2012-02-15 14:02:11
|
Update of /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions
In directory vz-cvs-4.sog:/tmp/cvs-serv26596/src/net/sourceforge/eclipseccase/ui/actions
Modified Files:
Tag: mike_diff_checkin
MCheckinAction.java
Log Message:
First version of new checkin dialog.
Index: MCheckinAction.java
===================================================================
RCS file: /cvsroot/eclipse-ccase/net.sourceforge.eclipseccase.ui/src/net/sourceforge/eclipseccase/ui/actions/Attic/MCheckinAction.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** MCheckinAction.java 10 Feb 2012 15:25:08 -0000 1.1.2.2
--- MCheckinAction.java 15 Feb 2012 14:02:08 -0000 1.1.2.3
***************
*** 12,15 ****
--- 12,21 ----
package net.sourceforge.eclipseccase.ui.actions;
+ import net.sourceforge.eclipseccase.ClearDlgHelper;
+
+ import net.sourceforge.eclipseccase.ClearCasePreferences;
+
+ import org.eclipse.core.resources.IFile;
+
import org.eclipse.jface.wizard.WizardDialog;
***************
*** 36,90 ****
/*
! * @see CVSAction#execute(IAction)
*/
@Override
- // public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- //
- // IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- //
- // public void run(IProgressMonitor monitor) throws CoreException {
- //
- // try {
- // IResource[] resources = getSelectedResources();
- // if (resources.length > 0) {
- // beginTask(monitor, "Checking in...", resources.length);
- //
- // if (ClearCasePreferences.isUseClearDlg()) {
- // monitor.subTask("Executing ClearCase user interface...");
- // ClearDlgHelper.checkin(resources);
- // } else {
- //
- // // Sort resources with directories last so that
- // // the
- // // modification of a
- // // directory doesn't abort the modification of
- // // files
- // // within it.
- // Arrays.sort(resources, new DirectoryLastComparator());
- //
- // CheckinWizard wizard = new CheckinWizard(resources);
- // WizardDialog dialog = new WizardDialog(getShell(), wizard);
- // //wizard.setParentDialog(dialog);
- // boolean commitOK = (dialog.open() == WizardDialog.OK);
- //
- // }
- // }
- // } finally {
- // monitor.done();
- // updateActionEnablement();
- // }
- // }
- // };
- //
- // executeInBackground(runnable, "Checking in ClearCase resources");
- // }
-
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
! IResource[] resources = getSelectedResources();
! if (resources.length > 0) {
! ClearCaseProvider provider = new ClearCaseProvider();
! CheckinWizard wizard = new CheckinWizard(resources,provider);
! WizardDialog dialog = new WizardDialog(getShell(), wizard);
! dialog.open();
}
}
--- 42,82 ----
/*
! * @see TeamAction#execute(IAction)
*/
@Override
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
! boolean canContinue = true;
! // prompt for saving dirty editors
! IFile[] unsavedFiles = getUnsavedFiles();
! if (unsavedFiles.length > 0) {
! canContinue = saveModifiedResourcesIfUserConfirms(unsavedFiles);
! }
!
! if (canContinue) {
!
! final IResource[] resources = getSelectedResources();
! if (resources.length > 0) {
! if (ClearCasePreferences.isUseClearDlg()) {
!
! IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
! public void run(IProgressMonitor monitor) throws CoreException {
! try {
! monitor.subTask("Executing ClearCase user interface...");
! ClearDlgHelper.checkin(resources);
! } finally {
! monitor.done();
! updateActionEnablement();
! }
! }
! };
! executeInBackground(runnable, "Checking in ClearCase resources");
! } else {
!
! ClearCaseProvider provider = new ClearCaseProvider();
! CheckinWizard wizard = new CheckinWizard(resources, provider);
! WizardDialog dialog = new WizardDialog(getShell(), wizard);
! dialog.open();
! }
! }
}
}
|