private IStatus calculateStatus(IRefreshEvent event) { StringBuffer text = new StringBuffer(); int code = IStatus.OK; int changeCount = event.getChangeDescription().getChangeCount(); int numChanges = getChangeCount(); if (numChanges > 0) { code = IRefreshEvent.STATUS_CHANGES; int incomingChanges = getIncomingChangeCount(); String numIncomingChanges = incomingChanges == 0 ? "" //$NON-NLS-1$ : NLS.bind( TeamUIMessages.RefreshCompleteDialog_incomingChanges, Integer.toString(incomingChanges)); int outgoingChanges = getOutgoingChangeCount(); String numOutgoingChanges = outgoingChanges == 0 ? "" //$NON-NLS-1$ : NLS.bind( TeamUIMessages.RefreshCompleteDialog_outgoingChanges, Integer.toString(outgoingChanges)); String sep = incomingChanges > 0 && outgoingChanges > 0 ? "; " : ""; // $NON-NLS-1$ //$NON-NLS-2$ if (changeCount > 0) { // New changes found code = IRefreshEvent.STATUS_NEW_CHANGES; String numNewChanges = Integer.toString(changeCount); if (changeCount == 1) { text.append( NLS.bind( TeamUIMessages.RefreshCompleteDialog_newChangesSingular, (new Object[] { getName(), numNewChanges, numIncomingChanges, sep, numOutgoingChanges }))); } else { text.append( NLS.bind( TeamUIMessages.RefreshCompleteDialog_newChangesPlural, (new Object[] { getName(), numNewChanges, numIncomingChanges, sep, numOutgoingChanges }))); } } else { // Refreshed resources contain changes if (numChanges == 1) { text.append( NLS.bind( TeamUIMessages.RefreshCompleteDialog_changesSingular, (new Object[] { getName(), new Integer(numChanges), numIncomingChanges, sep, numOutgoingChanges }))); } else { text.append( NLS.bind( TeamUIMessages.RefreshCompleteDialog_changesPlural, (new Object[] { getName(), new Integer(numChanges), numIncomingChanges, sep, numOutgoingChanges }))); } } } else { // No changes found code = IRefreshEvent.STATUS_NO_CHANGES; text.append(NLS.bind(TeamUIMessages.RefreshCompleteDialog_6, new String[] {getName()})); } return new Status(IStatus.OK, TeamUIPlugin.ID, code, text.toString(), null); }
public String getTransferOuput() { return m_output.toString(); }