1/******************************************************************************* 2 * Copyright (c) 2011 Google, Inc. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * Google, Inc. - initial API and implementation 10 *******************************************************************************/ 11package org.eclipse.wb.internal.core.utils.ui; 12 13import org.eclipse.jface.dialogs.IDialogConstants; 14import org.eclipse.jface.dialogs.MessageDialog; 15import org.eclipse.swt.widgets.Shell; 16 17/** 18 * Utilities for UI. 19 * 20 * @author scheglov_ke 21 */ 22public class UiUtils { 23 //////////////////////////////////////////////////////////////////////////// 24 // 25 // Message dialogs 26 // 27 //////////////////////////////////////////////////////////////////////////// 28 /** 29 * Opens standard warning dialog. 30 */ 31 public static void openWarning(Shell parent, String title, String message) { 32 MessageDialog dialog = 33 new MessageDialog(parent, 34 title, 35 null, 36 message, 37 MessageDialog.WARNING, 38 new String[]{IDialogConstants.OK_LABEL}, 39 0); 40 dialog.open(); 41 } 42}