public class AliasWindowManager { /** Logger for this class. */ private static final ILogger s_log = LoggerController.createLogger(AliasWindowManager.class); /** Application API. */ private final IApplication _app; /** Window Factory for alias maintenace windows. */ private final AliasWindowFactory _aliasWinFactory; /** * Ctor. * * @param app Application API. * * @throws IllegalArgumentException * Thrown if <TT>null</TT> <TT>IApplication</TT> passed. */ public AliasWindowManager(IApplication app) { super(); if (app == null) { throw new IllegalArgumentException("IApplication == null"); } _app = app; _aliasWinFactory = new AliasWindowFactory(_app); } /** * Get a maintenance sheet for the passed alias. If a maintenance sheet already * exists it will be brought to the front. If one doesn't exist it will be * created. * * @param alias The alias that user has requested to modify. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed. */ public void showModifyAliasInternalFrame(final ISQLAlias alias) { if (alias == null) { throw new IllegalArgumentException("ISQLAlias == null"); } moveToFront(_aliasWinFactory.getModifySheet(alias)); } /** * Create and show a new maintenance window to allow the user to create a * new alias. */ public void showNewAliasInternalFrame() { moveToFront(_aliasWinFactory.getCreateSheet()); } /** * Create and show a new maintenance sheet that will allow the user to create a * new alias that is a copy of the passed one. * * @return The new maintenance sheet. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed. */ public void showCopyAliasInternalFrame(final SQLAlias alias) { if (alias == null) { throw new IllegalArgumentException("ISQLAlias == null"); } moveToFront(_aliasWinFactory.getCopySheet(alias)); } public void moveToFront(final AliasInternalFrame fr) { if (fr != null) { GUIUtils.processOnSwingEventThread(new Runnable() { public void run() { fr.moveToFront(); } }); } else { s_log.debug("JInternalFrame == null")
public class DriverWindowManager { /** Logger for this class. */ private static final ILogger s_log = LoggerController.createLogger(WindowManager.class); /** Application API. */ private final IApplication _app; /** Window Factory for driver maintenace windows. */ private final DriverWindowFactory _driverWinFactory; /** * Ctor. * * @param app Application API. * * @throws IllegalArgumentException * Thrown if <TT>null</TT> <TT>IApplication</TT> passed. */ public DriverWindowManager(IApplication app) { super(); if (app == null) { throw new IllegalArgumentException("IApplication == null"); } _app = app; _driverWinFactory = new DriverWindowFactory(_app); } /** * Get a maintenance sheet for the passed driver. If a maintenance sheet * already exists it will be brought to the front. If one doesn't exist * it will be created. * * @param driver The driver that user has requested to modify. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed. */ public void showModifyDriverInternalFrame(final ISQLDriver driver) { if (driver == null) { throw new IllegalArgumentException("ISQLDriver == null"); } _driverWinFactory.getModifySheet(driver).moveToFront(); } /** * Create and show a new maintenance window to allow the user to create a * new driver. */ public void showNewDriverInternalFrame() { _driverWinFactory.getCreateSheet().moveToFront(); } /** * Create and show a new maintenance sheet that will allow the user to * create a new driver that is a copy of the passed one. * * @return The new maintenance sheet. * * @throws IllegalArgumentException * Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed. */ public void showCopyDriverInternalFrame(final ISQLDriver driver) { if (driver == null) { throw new IllegalArgumentException("ISQLDriver == null"); } _driverWinFactory.showCopySheet(driver).moveToFront(); } public void moveToFront(final JInternalFrame fr) { if (fr != null) { GUIUtils.processOnSwingEventThread(new Runnable() { public void run() { GUIUtils.moveToFront(fr); } }); } else { s_log.debug("JInternalFrame == null")
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/AliasWindowManager.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/DriverWindowManager.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class AliasWindowManager
1
public class DriverWindowManager
2
{
2
{
3
	/** Logger for this class. */
3
	/** Logger for this class. */
4
	private static final ILogger s_log =
4
	private static final ILogger s_log =
5
		LoggerController.createLogger(AliasWindowManager.class);
5
		LoggerController.createLogger(WindowManager.class);
6
	/** Application API. */
6
	/** Application API. */
7
	private final IApplication _app;
7
	private final IApplication _app;
8
	/** Window Factory for alias maintenace windows. */
8
	/** Window Factory for driver maintenace windows. */
9
	private final AliasWindowFactory _aliasWinFactory;
9
	private final DriverWindowFactory _driverWinFactory;
10
	/**
10
	/**
11
	 * Ctor.
11
	 * Ctor.
12
	 *
12
	 *
13
	 * @param	app		Application API.
13
	 * @param	app		Application API.
14
	 *
14
	 *
15
	 * @throws	IllegalArgumentException
15
	 * @throws	IllegalArgumentException
16
	 * 			Thrown if <TT>null</TT> <TT>IApplication</TT> passed.
16
	 * 			Thrown if <TT>null</TT> <TT>IApplication</TT> passed.
17
	 */
17
	 */
18
	public AliasWindowManager(IApplication app)
18
	public DriverWindowManager(IApplication app)
19
	{
19
	{
20
		super();
20
		super();
21
		if (app == null)
21
		if (app == null)
22
		{
22
		{
23
			throw new IllegalArgumentException("IApplication == null");
23
			throw new IllegalArgumentException("IApplication == null");
24
		}
24
		}
25
		_app = app;
25
		_app = app;
26
		_aliasWinFactory = new AliasWindowFactory(_app);
26
		_driverWinFactory = new DriverWindowFactory(_app);
27
	}
27
	}
28
	/**
28
	/**
29
	 * Get a maintenance sheet for the passed alias. If a maintenance sheet
29
	 * Get a maintenance sheet for the passed driver. If a maintenance sheet
30
 already
30
	 * already
31
	 * exists it will be brought to the front. If one doesn't exist
31
 exists it will be brought to the front. If one doesn't exist
32
 it will be
32
	 * it will be
33
	 * created.
33
 created.
34
	 *
34
	 *
35
	 * @param	alias	The alias that user has requested to modify.
35
	 * @param	driver	The driver that user has requested to modify.
36
	 *
36
	 *
37
	 * @throws	IllegalArgumentException
37
	 * @throws	IllegalArgumentException
38
	 *			Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed.
38
	 *			Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed.
39
	 */
39
	 */
40
	public void showModifyAliasInternalFrame(final ISQLAlias alias)
40
	public void showModifyDriverInternalFrame(final ISQLDriver driver)
41
	{
41
	{
42
		if (alias == null)
42
		if (driver == null)
43
		{
43
		{
44
			throw new IllegalArgumentException("ISQLAlias == null");
44
			throw new IllegalArgumentException("ISQLDriver == null");
45
		}
45
		}
46
		moveToFront(_aliasWinFactory.getModifySheet(alias));
46
      _driverWinFactory.getModifySheet(driver).moveToFront();
47
	}
47
	}
48
	/**
48
	/**
49
	 * Create and show a new maintenance window to allow the user to create a
49
	 * Create and show a new maintenance window to allow the user to create a
50
	 * new alias.
50
	 * new driver.
51
	 */
51
	 */
52
	public void showNewAliasInternalFrame()
52
	public void showNewDriverInternalFrame()
53
	{
53
	{
54
		moveToFront(_aliasWinFactory.getCreateSheet());
54
      _driverWinFactory.getCreateSheet().moveToFront();
55
	}
55
	}
56
	/**
56
	/**
57
	 * Create and show a new maintenance sheet that will allow the user to
57
	 * Create and show a new maintenance sheet that will allow the user to
58
 create a
58
	 * create a
59
	 * new alias that is a copy of the passed one.
59
 new driver that is a copy of the passed one.
60
	 *
60
	 *
61
	 * @return	The new maintenance sheet.
61
	 * @return	The new maintenance sheet.
62
	 *
62
	 *
63
	 * @throws	IllegalArgumentException
63
	 * @throws	IllegalArgumentException
64
	 *			Thrown if a <TT>null</TT> <TT>ISQLAlias</TT> passed.
64
	 *			Thrown if a <TT>null</TT> <TT>ISQLDriver</TT> passed.
65
	 */
65
	 */
66
	public void showCopyAliasInternalFrame(final SQLAlias alias)
66
	public void showCopyDriverInternalFrame(final ISQLDriver driver)
67
	{
67
	{
68
		if (alias == null)
68
		if (driver == null)
69
		{
69
		{
70
			throw new IllegalArgumentException("ISQLAlias == null");
70
			throw new IllegalArgumentException("ISQLDriver == null");
71
		}
71
		}
72
		moveToFront(_aliasWinFactory.getCopySheet(alias));
72
      _driverWinFactory.showCopySheet(
73
	
73
driver).moveToFront();
74
}
74
   }
75
	public void moveToFront(final AliasInternalFrame fr)
75
	public void moveToFront(final JInternalFrame fr)
76
	{
76
	{
77
		if (fr != null)
77
		if (fr != null)
78
		{
78
		{
79
			GUIUtils.processOnSwingEventThread(new Runnable()
79
			GUIUtils.processOnSwingEventThread(new Runnable()
80
			{
80
			{
81
				public void run()
81
				public void run()
82
				{
82
				{
83
					fr.moveToFront();
83
					GUIUtils.moveToFront(fr);
84
				}
84
				}
85
			});
85
			});
86
		}
86
		}
87
		else
87
		else
88
		{
88
		{
89
			s_log.debug("JInternalFrame == null")
89
			s_log.debug("JInternalFrame == null")
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0