| /******************************************************************************* |
| * Copyright (c) 2008-2011 Chair for Applied Software Engineering, |
| * Technische Universitaet Muenchen. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| ******************************************************************************/ |
| package org.eclipse.emf.emfstore.server.startup; |
| |
| import org.eclipse.core.runtime.IProgressMonitor; |
| |
| /** |
| * Progress Monitor with console output. |
| * |
| * @author koegel |
| */ |
| public class ConsoleProgressMonitor implements IProgressMonitor { |
| |
| /** |
| * Indicates whether cancel has been requested. |
| */ |
| private boolean cancelled; |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String, int) |
| */ |
| public void beginTask(String name, int totalWork) { |
| System.out.print(name + ":"); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#done() |
| */ |
| public void done() { |
| System.out.println("...DONE"); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double) |
| */ |
| public void internalWorked(double work) { |
| // do nothing |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled() {@inheritDoc} |
| */ |
| public boolean isCanceled() { |
| return cancelled; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean) |
| */ |
| public void setCanceled(boolean cancelled) { |
| this.cancelled = cancelled; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String) |
| */ |
| public void setTaskName(String name) { |
| // do nothing |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String) |
| */ |
| public void subTask(String name) { |
| // do nothing |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.core.runtime.IProgressMonitor#worked(int) |
| */ |
| public void worked(int work) { |
| System.out.print("."); |
| } |
| |
| } |