org.malai.instrument.library
Class MenuItem2ShowComponentLink<N extends Instrument>

java.lang.Object
  extended by org.malai.instrument.Link<ShowWidget,MenuItemPressed,N>
      extended by org.malai.instrument.library.MenuItem2ShowComponentLink<N>
Type Parameters:
N - The type of the instrument that will contain this link.
All Implemented Interfaces:
InteractionHandler
Direct Known Subclasses:
MenuItem2AboutFrame, MenuItem2ShowPreferencesLink

public class MenuItem2ShowComponentLink<N extends Instrument>
extends Link<ShowWidget,MenuItemPressed,N>

This link links a menu item interaction to an action that shows a JComponent.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

11/20/2010

Since:
0.2
Author:
Arnaud BLOUIN

Field Summary
protected  java.awt.Component component
          The component to show.
protected  MMenuItem menuItem
          The menu item used to shows the component.
 
Fields inherited from class org.malai.instrument.Link
action, clazzAction, execute, instrument, interaction
 
Constructor Summary
MenuItem2ShowComponentLink(N ins, java.awt.Component component, MMenuItem menuItem)
          Creates the link.
 
Method Summary
 void initAction()
          After being created by method createAction, the action must be initialised by this method.
 boolean isConditionRespected()
           
 
Methods inherited from class org.malai.instrument.Link
addEventable, clearEvents, createAction, getAction, getInstrument, getInteraction, interactionAborts, interactionStarts, interactionStops, interactionUpdates, interimFeedback, isActivated, isExecute, isInteractionMustBeAborted, isRunnable, isRunning, setActivated, updateAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuItem

protected MMenuItem menuItem
The menu item used to shows the component.


component

protected java.awt.Component component
The component to show.

Constructor Detail

MenuItem2ShowComponentLink

public MenuItem2ShowComponentLink(N ins,
                                  java.awt.Component component,
                                  MMenuItem menuItem)
                           throws java.lang.InstantiationException,
                                  java.lang.IllegalAccessException
Creates the link.

Parameters:
ins - The instrument that contains the link.
component - The component to show/hide.
menuItem - The menu item used to show/hide to component.
Throws:
java.lang.IllegalAccessException - If no free-parameter constructor is available.
java.lang.InstantiationException - If an error occurs during instantiation of the interaction/action.
Since:
0.2
Method Detail

initAction

public void initAction()
Description copied from class: Link
After being created by method createAction, the action must be initialised by this method.

Specified by:
initAction in class Link<ShowWidget,MenuItemPressed,N extends Instrument>

isConditionRespected

public boolean isConditionRespected()
Specified by:
isConditionRespected in class Link<ShowWidget,MenuItemPressed,N extends Instrument>
Returns:
True if the condition of the link is respected.