import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
+import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
{
private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
- protected static final String VIEWS_FILTER = "VIEWS_FILTER";
+ public static final String VIEWS_FILTER = "VIEWS_FILTER";
protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
+ "...\"")
: JvSwingUtils.wrapTooltip(true, toolTipText)));
return toolTipText;
- }
+ }
};
public GStructureChooser()
tbl_summary.addMouseListener(new MouseAdapter()
{
@Override
+ public void mousePressed(MouseEvent e)
+ {
+ if (!popupAction(e))
+ {
+ super.mousePressed(e);
+ }
+ }
+ @Override
public void mouseClicked(MouseEvent e)
{
- validateSelections();
+ if (!popupAction(e))
+ {
+ validateSelections();
+ }
}
@Override
public void mouseReleased(MouseEvent e)
{
+ if (!popupAction(e))
+ {
validateSelections();
+ }
+ }
+ boolean popupAction(MouseEvent e)
+ {
+ if (e.isPopupTrigger())
+ {
+ Point pt = e.getPoint();
+ int selectedRow = tbl_summary.rowAtPoint(pt);
+ if (showPopupFor(selectedRow))
+ {
+ return true;
+ }
+ }
+ return false;
}
});
tbl_summary.addKeyListener(new KeyAdapter()
}
+protected abstract boolean showPopupFor(int selectedRow);
protected void closeAction(int preferredHeight)
{
// System.out.println(">>>>>>>>>> closing internal frame!!!");
}
/**
- * This inner class provides the data model for the structure filter combo-box
- *
- * @author tcnofoegbu
- *
- */
- public class FilterOption
- {
- private String name;
-
- private String value;
-
- private String view;
-
- private boolean addSeparatorAfter;
-
- /**
- * Model for structure filter option
- *
- * @param name
- * - the name of the Option
- * @param value
- * - the value of the option
- * @param view
- * - the category of the filter option
- * @param addSeparatorAfter
- * - if true, a horizontal separator is rendered immediately after
- * this filter option, otherwise
- */
- public FilterOption(String name, String value, String view,
- boolean addSeparatorAfter)
- {
- this.name = name;
- this.value = value;
- this.view = view;
- this.addSeparatorAfter = addSeparatorAfter;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
- public String getView()
- {
- return view;
- }
-
- public void setView(String view)
- {
- this.view = view;
- }
-
- @Override
- public String toString()
- {
- return this.name;
- }
-
- public boolean isAddSeparatorAfter()
- {
- return addSeparatorAfter;
- }
-
- public void setAddSeparatorAfter(boolean addSeparatorAfter)
- {
- this.addSeparatorAfter = addSeparatorAfter;
- }
- }
-
- /**
* This inner class provides the provides the data model for associate
* sequence combo-box - cmb_assSeq
*