01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.corext.refactoring.reorg;
11:
12: import org.eclipse.core.runtime.OperationCanceledException;
13:
14: /**
15: * Null implementation of reorg queries.
16: *
17: * @since 3.3
18: */
19: public final class NullReorgQueries implements IReorgQueries {
20:
21: /** Null implementation of confirm query */
22: private static final class NullConfirmQuery implements
23: IConfirmQuery {
24:
25: /**
26: * {@inheritDoc}
27: */
28: public boolean confirm(String question)
29: throws OperationCanceledException {
30: return true;
31: }
32:
33: /**
34: * {@inheritDoc}
35: */
36: public boolean confirm(String question, Object[] elements)
37: throws OperationCanceledException {
38: return true;
39: }
40: }
41:
42: /** The null query */
43: private static final IConfirmQuery NULL_QUERY = new NullConfirmQuery();
44:
45: /**
46: * {@inheritDoc}
47: */
48: public IConfirmQuery createSkipQuery(String queryTitle, int queryID) {
49: return NULL_QUERY;
50: }
51:
52: /**
53: * {@inheritDoc}
54: */
55: public IConfirmQuery createYesNoQuery(String queryTitle,
56: boolean allowCancel, int queryID) {
57: return NULL_QUERY;
58: }
59:
60: /**
61: * {@inheritDoc}
62: */
63: public IConfirmQuery createYesYesToAllNoNoToAllQuery(
64: String queryTitle, boolean allowCancel, int queryID) {
65: return NULL_QUERY;
66: }
67: }
|