All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.squirrel_sql.fw.gui.IDialogUtils Maven / Gradle / Ivy

Go to download

The framework library contains utility classes that are generic and useful for building applications that introspect a database via JDBC. These are not intended to be SQuirreLSQL-specific and could be used by other projects JDBC front-end applications. This project is guaranteed to have no code dependencies on other SQuirreLSQL projects and could therefore be used when building a different JDBC front-end application.

There is a newer version: 3.5.0
Show newest version
/*
 * Copyright (C) 2007 Rob Manning
 * [email protected]
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package net.sourceforge.squirrel_sql.fw.gui;

import java.awt.Component;
import java.awt.Frame;
import java.io.File;

import javax.swing.Icon;
import javax.swing.JComponent;

import net.sourceforge.squirrel_sql.fw.util.FileExtensionFilter;

/**
 * This "describes" the interface of Dialogs which is a static method utility class. Class should get an
 * instance of this injected into them if they want to avoid direct dependence on GUI framework objects.
 * 
 * @author manningr
 */
public interface IDialogUtils
{

	File selectFileForWriting(Frame parentFrame, FileExtensionFilter[] filters);

	File selectFileForWriting(Frame parentFrame, FileExtensionFilter[] filters, JComponent accessory);

	void showNotYetImplemented(Component owner);

	boolean showYesNo(Component owner, String msg);

	boolean showYesNo(Component owner, String msg, String title);

	void showOk(Component owner, String msg);

	/**
	 * From JavaDoc for JOptionPane.showInputDialog:
	 * 
	 * Prompts the user for input in a blocking dialog where the initial selection, possible selections, and
	 * all other options can be specified. The user will able to choose from selectionValues,
	 * where null implies the user can input whatever they wish, usually by means of a
	 * JTextField. initialSelectionValue is the initial value to prompt the user
	 * with. It is up to the UI to decide how best to represent the selectionValues, but usually a
	 * JComboBox, JList, or JTextField will be used.
	 * 
	 * @param parentComponent
	 *           the parent Component for the dialog
	 * @param message
	 *           the Object to display
	 * @param title
	 *           the String to display in the dialog title bar
	 * @param messageType
	 *           the type of message to be displayed: ERROR_MESSAGE,
	 *           INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE,
	 *           or PLAIN_MESSAGE
	 * @param icon
	 *           the Icon image to display
	 * @param selectionValues
	 *           an array of Objects that gives the possible selections
	 * @param initialSelectionValue
	 *           the value used to initialize the input field
	 * @return user's input, or null meaning the user canceled the input
	 * @exception HeadlessException
	 *               if GraphicsEnvironment.isHeadless returns true
	 */
	public String showInputDialog(Component parentComponent, Object message, String title, int messageType,
		Icon icon, Object[] selectionValues, Object initialSelectionValue);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy