presets = service.getParamStore().getPresets();
+ if (presets != null && presets.size() > 0)
{
- final JMenuItem methodR = new JMenuItem(preset.getName());
- methodR.setToolTipText(""
- + (preset.isModifiable() ? "User Preset"
- : "Service Preset") + "
"
- + preset.getDescription() + "
");
- methodR.addActionListener(new ActionListener()
+ JMenu presetlist = new JMenu(MessageManager.formatMessage(
+ "label.run_with_preset_params", new String[]
+ { calcName }));
+
+ final int showToolTipFor = ToolTipManager.sharedInstance()
+ .getDismissDelay();
+ for (final WsParamSetI preset : presets)
{
- public void actionPerformed(ActionEvent e)
+ final JMenuItem methodR = new JMenuItem(preset.getName());
+ final int QUICK_TOOLTIP = 1500;
+ // JAL-1582 shorten tooltip display time in these menu items as
+ // they can obscure other options
+ methodR.addMouseListener(new MouseAdapter()
{
- AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- new MsaWSClient(service, preset, alignFrame.getTitle(), msa,
- false, true, alignFrame.getViewport().getAlignment()
- .getDataset(), alignFrame);
+ @Override
+ public void mouseEntered(MouseEvent e)
+ {
+ ToolTipManager.sharedInstance().setDismissDelay(
+ QUICK_TOOLTIP);
+ }
- }
+ @Override
+ public void mouseExited(MouseEvent e)
+ {
+ ToolTipManager.sharedInstance().setDismissDelay(showToolTipFor);
+ }
- });
- presetlist.add(methodR);
+ });
+ methodR.setToolTipText(JvSwingUtils.wrapTooltip(
+ true,
+ ""
+ + (preset.isModifiable() ? MessageManager
+ .getString("label.user_preset")
+ : MessageManager
+ .getString("label.service_preset"))
+ + "
" + preset.getDescription()
+ + "
"));
+ methodR.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ AlignmentView msa = alignFrame
+ .gatherSequencesForAlignment();
+
+ if (msa != null)
+ {
+ MsaWSClient msac = new MsaWSClient(service, preset,
+ alignFrame.getTitle(),
+ msa, false, true, alignFrame.getViewport()
+ .getAlignment().getDataset(), alignFrame);
+ }
+
+ }
+
+ });
+ presetlist.add(methodR);
+ }
+ msawsmenu.add(presetlist);
}
- msawsmenu.add(presetlist);
}
if (!submitGaps && canSubmitGaps())
{