]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.workbench/src/org/simantics/workbench/internal/JFaceUserAgent.java
Improve startup time for fresh or rollback'd session in index writing
[simantics/platform.git] / bundles / org.simantics.workbench / src / org / simantics / workbench / internal / JFaceUserAgent.java
1 /*******************************************************************************
2  * Copyright (c) 2011 Association for Decentralized Information Management in
3  * Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.workbench.internal;
13
14 import org.eclipse.jface.dialogs.MessageDialog;
15 import org.simantics.PlatformUserAgent;
16
17 /**
18  * @author Tuukka Lehtonen
19  */
20 public class JFaceUserAgent implements PlatformUserAgent {
21
22     @Override
23     public int showPrompt(String title, String message, String[] options, int defaultChoice) {
24         MessageDialog dialog = new MessageDialog(
25                 null,
26                 title,
27                 null,
28                 message,
29                 MessageDialog.QUESTION,
30                 options,
31                 defaultChoice);
32         return dialog.open();
33     }
34
35 }