List of usage examples for javax.swing Action SHORT_DESCRIPTION
String SHORT_DESCRIPTION
To view the source code for javax.swing Action SHORT_DESCRIPTION.
Click Source Link
String
description for the action, used for tooltip text. From source file:tvbrowser.extras.reminderplugin.ReminderPlugin.java
protected static ActionMenu getButtonAction() { AbstractAction action = new AbstractAction() { public void actionPerformed(ActionEvent evt) { getInstance().showManageRemindersDialog(); }//from ww w . jav a 2s. c o m }; action.putValue(Action.NAME, getName()); action.putValue(Action.SMALL_ICON, IconLoader.getInstance().getIconFromTheme("apps", "appointment", 16)); action.putValue(Plugin.BIG_ICON, IconLoader.getInstance().getIconFromTheme("apps", "appointment", 22)); action.putValue(Action.SHORT_DESCRIPTION, mLocalizer.msg("description", "Reminds you of programs to not miss them.")); return new ActionMenu(action); }
From source file:com.intuit.tank.tools.debugger.ActionProducer.java
/** * /*from w w w. j av a 2 s . c o m*/ * @return */ public Action getShowVariablesAction() { Action ret = actionMap.get(ACTION_SHOW_VARIABLES); if (ret == null) { ret = new AbstractAction(ACTION_SHOW_VARIABLES, getIcon("data_grid.png", IconSize.SMALL)) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { try { new VariableDialog(debuggerFrame, debuggerFrame.getProjectVariables()).setVisible(true); } catch (Exception e1) { showError("Error downloading datafiles: " + e1); } } }; ret.putValue(Action.SHORT_DESCRIPTION, "Display and edit project variables."); actionMap.put(ACTION_SHOW_VARIABLES, ret); } return ret; }
From source file:ca.phon.app.project.ProjectWindow.java
private MultiActionButton createNewSessionButton() { MultiActionButton retVal = new MultiActionButton(); ImageIcon newIcn = IconManager.getInstance().getIcon("mimetypes/text-xml", IconSize.SMALL); ImageIcon newIcnL = IconManager.getInstance().getIcon("actions/list-add", IconSize.MEDIUM); ImageIcon removeIcnL = IconManager.getInstance().getIcon("actions/list-remove", IconSize.MEDIUM); ImageIcon renameIcnL = IconManager.getInstance().getIcon("actions/edit-rename", IconSize.MEDIUM); ImageIcon openIcnL = IconManager.getInstance().getIcon("actions/view", IconSize.MEDIUM); String s1 = "Session"; retVal.getTopLabel().setText(WorkspaceTextStyler.toHeaderText(s1)); retVal.getTopLabel().setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); retVal.getTopLabel().setFont(FontPreferences.getTitleFont()); retVal.getTopLabel().setIcon(newIcn); retVal.setOpaque(false);//w w w . j ava 2s. c o m PhonUIAction newAct = new PhonUIAction(this, "onSwapNewAndCreateSession", retVal); newAct.putValue(Action.LARGE_ICON_KEY, newIcnL); newAct.putValue(Action.SMALL_ICON, newIcn); newAct.putValue(Action.NAME, "New session"); newAct.putValue(Action.SHORT_DESCRIPTION, "Create a new session in selected corpus"); retVal.setDefaultAction(newAct); DeleteSessionAction deleteCurrentAct = new DeleteSessionAction(this); deleteCurrentAct.putValue(Action.LARGE_ICON_KEY, removeIcnL); PhonUIAction renameCurrentAct = new PhonUIAction(this, "onRenameSession"); renameCurrentAct.putValue(Action.LARGE_ICON_KEY, renameIcnL); renameCurrentAct.putValue(Action.NAME, "Rename session"); renameCurrentAct.putValue(Action.SHORT_DESCRIPTION, "Rename selected session"); PhonUIAction openCurrentAct = new PhonUIAction(this, "onOpenSession"); openCurrentAct.putValue(Action.LARGE_ICON_KEY, openIcnL); openCurrentAct.putValue(Action.NAME, "Open session"); openCurrentAct.putValue(Action.SHORT_DESCRIPTION, "Open selected session"); retVal.setDisplayDefaultAction(true); retVal.addAction(deleteCurrentAct); retVal.addAction(renameCurrentAct); retVal.addAction(openCurrentAct); retVal.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); return retVal; }
From source file:org.apache.log4j.chainsaw.LogUI.java
/** * Initialises the Help system and the WelcomePanel * *//* ww w.ja v a 2 s . c om*/ private void setupHelpSystem() { welcomePanel = new WelcomePanel(); JToolBar tb = welcomePanel.getToolbar(); tb.add(new SmallButton(new AbstractAction("Tutorial", new ImageIcon(ChainsawIcons.HELP)) { public void actionPerformed(ActionEvent e) { setupTutorial(); } })); tb.addSeparator(); final Action exampleConfigAction = new AbstractAction("View example Receiver configuration") { public void actionPerformed(ActionEvent e) { HelpManager.getInstance().setHelpURL(ChainsawConstants.EXAMPLE_CONFIG_URL); } }; exampleConfigAction.putValue(Action.SHORT_DESCRIPTION, "Displays an example Log4j configuration file with several Receivers defined."); JButton exampleButton = new SmallButton(exampleConfigAction); tb.add(exampleButton); tb.add(Box.createHorizontalGlue()); /** * Setup a listener on the HelpURL property and automatically change the WelcomePages URL * to it. */ HelpManager.getInstance().addPropertyChangeListener("helpURL", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { URL newURL = (URL) evt.getNewValue(); if (newURL != null) { welcomePanel.setURL(newURL); ensureWelcomePanelVisible(); } } }); }
From source file:net.sf.jabref.gui.plaintextimport.TextInputDialog.java
public BasicAction(String text, String description, Icon icon) { super(text, icon); putValue(Action.SHORT_DESCRIPTION, description); }
From source file:com.intuit.tank.tools.debugger.ActionProducer.java
/** * /*from ww w .ja v a2 s . c om*/ * @return */ public Action getOpenProjectAction() { Action ret = actionMap.get(ACTION_CHOOSE_PROJECT); if (ret == null) { ret = new AbstractAction(ACTION_CHOOSE_PROJECT, getIcon("application_lightning.png", IconSize.SMALL)) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { try { List<ProjectTO> projects = projectServiceClient.getProjects(); Collections.sort(projects, new Comparator<ProjectTO>() { @Override public int compare(ProjectTO o1, ProjectTO o2) { return o2.getCreated().compareTo(o1.getCreated()); } }); SelectDialog<ProjectTO> selectDialog = new SelectDialog<ProjectTO>(debuggerFrame, projects, "project"); selectDialog.setVisible(true); final ProjectTO selected = selectDialog.getSelectedObject(); if (selected != null) { debuggerFrame.startWaiting(); setFromString(null); // get script in thread new Thread(new Runnable() { public void run() { try { String scriptXml = projectServiceClient .downloadTestScriptForProject(selected.getId()); debuggerFrame.setDataFromProject(selected); setFromString(scriptXml); debuggerFrame.setCurrentTitle("Selected Project: " + selected.getName()); debuggerFrame.setScriptSource( new ScriptSource(selected.getId().toString(), SourceType.project)); debuggerFrame.stopWaiting(); } catch (Exception e1) { e1.printStackTrace(); debuggerFrame.stopWaiting(); showError("Error opening projects: " + e1); } finally { debuggerFrame.stopWaiting(); } } }).start(); } } catch (Exception e1) { showError("Error opening projects: " + e1); } } }; ret.putValue(Action.SHORT_DESCRIPTION, "Choose Project from Tank."); actionMap.put(ACTION_CHOOSE_PROJECT, ret); } return ret; }
From source file:com.mirth.connect.client.ui.editors.filter.FilterPane.java
public BoundAction initActionCallback(String callbackMethod, String toolTip, BoundAction boundAction, ImageIcon icon) {/* w ww .j av a 2 s.c om*/ if (icon != null) { boundAction.putValue(Action.SMALL_ICON, icon); } boundAction.putValue(Action.SHORT_DESCRIPTION, toolTip); boundAction.registerCallback(this, callbackMethod); return boundAction; }
From source file:com.diversityarrays.kdxplore.curate.SampleEntryPanel.java
public void setCurationCellValue(List<CurationCellValue> ccvList) { initSampleSourceComboBox(null);/*from ww w .java 2 s . c o m*/ this.curationCellValues = ccvList; showingMultiCell = false; Map<Integer, SampleSource> kdsmartSampleSourceBySampleGroupId = new HashMap<>(); sampleValueTextField.setText(""); //$NON-NLS-1$ valueDescription.setText(""); //$NON-NLS-1$ Map<TableColumn, Integer> widthByColumn = null; // getTableColumnWidths(); if (curationCellValues == null) { typedSampleTableModel.clear(); } else { showingMultiCell = curationCellValues.size() > 1; List<TypedSampleMeasurement> typedSampleMeasurements = new ArrayList<>(); List<KdxSample> kdsmartSamples = new ArrayList<>(); // int nKdsmartMeasurements = 0; for (CurationCellValue ccvd : curationCellValues) { KdxSample ed = ccvd.getEditedSample(); Date edWhen = ed == null ? null : ed.getMeasureDateTime(); // NOTE: we DO want all of the KDSmart device samples. // so DON'T just use the first sample for (KdxSample sm : ccvd.getRawSamples()) { DeviceIdentifier did = curationData.getDeviceIdentifierForSampleGroup(sm.getSampleGroupId()); Date sampleGroupDate = curationData.getSampleGroupDateLoaded(sm.getSampleGroupId()); boolean moreRecent = false; if (edWhen != null && sm.hasBeenScored() && sm.getMeasureDateTime().after(edWhen)) { moreRecent = true; } TypedSampleMeasurement tsm = makeTypedSampleMeasurement(did, sm, sampleGroupDate, moreRecent); typedSampleMeasurements.add(tsm); Integer sampleGroupId = sm.getSampleGroupId(); if (!kdsmartSampleSourceBySampleGroupId.containsKey(sampleGroupId)) { kdsmartSampleSourceBySampleGroupId.put(sampleGroupId, SampleSource .createDeviceSampleSource(did.getDeviceName(), sampleGroupId, sampleGroupDate)); } } // nKdsmartMeasurements = typedSampleMeasurements.size(); kdsmartSamples.addAll(ccvd.getRawSamples()); KdxSample db = ccvd.getDatabaseSample(); if (db != null && db.hasBeenScored()) { DeviceIdentifier did = curationData.getDeviceIdentifierForSampleGroup(db.getSampleGroupId()); Date sampleGroupDate = curationData.getSampleGroupDateLoaded(db.getSampleGroupId()); typedSampleMeasurements.add(makeTypedSampleMeasurement(did, db, sampleGroupDate, false)); } if (ed != null) { DeviceIdentifier did = curationData.getDeviceIdentifierForSampleGroup(ed.getSampleGroupId()); Date sampleGroupDate = curationData.getSampleGroupDateLoaded(ed.getSampleGroupId()); typedSampleMeasurements.add(makeTypedSampleMeasurement(did, ed, sampleGroupDate, false)); } } kdsmartSampleStatistics = null; traitBeingEdited = null; if (kdsmartSamples != null && !kdsmartSamples.isEmpty()) { KdxSample sample = kdsmartSamples.get(0); traitBeingEdited = traitProvider.apply(sample.getTraitId()); if (traitBeingEdited.getTraitDataType().isNumeric() && kdsmartSamples.size() >= 2) { String statsName = curationData.getTrial().getTraitNameStyle().makeTraitInstanceName( traitBeingEdited.getAliasOrName(), sample.getTraitInstanceNumber()); kdsmartSampleStatistics = StatsUtil.createStatistics(statsName, curationData.getNumberOfStdDevForOutlier(), curationData.getTrial().getTrialPlantingDate(), traitBeingEdited, kdsmartSamples); } } boolean wantPPI = showPpiOption.isSelected(); // Work out how we can make the name unique DateFormat rendererDateFormat; TsmDateFormatSelector formatSelector = new TsmDateFormatSelector(); rendererDateFormat = formatSelector.getFormatForUniqueness(typedSampleMeasurements); // rendererDateFormat = TypedSampleMeasurement.getDateFormatForUniqueIdent(typedSampleMeasurements, shortDateFormat, longDateFormat); tsmCellRenderer.setDateFormat(rendererDateFormat); int rowHeight = initialTableRowHeight; if (rendererDateFormat == TsmDateFormatSelector.SHORT_DATE_FORMAT) { rowHeight = rowHeight * 2; } else if (rendererDateFormat == TsmDateFormatSelector.LONG_DATE_FORMAT) { rowHeight = rowHeight * 3; } typedSampleTable.setRowHeight(rowHeight); typedSampleTableModel.setData(typedSampleMeasurements, showingMultiCell, wantPPI); if (!everSetData) { typedSampleTable.setAutoCreateColumnsFromModel(false); everSetData = true; } } restoreColumnWidths(widthByColumn); // TODO remove this - no longer required applyToPanel.getApplyTo().applyToCheckboxes(); // multiCellControlsPanel.applyToCheckboxes(); initSampleSourceComboBox(kdsmartSampleSourceBySampleGroupId); singleOrMultiCardLayout.show(singleOrMultiCardPanel, showingMultiCell ? CARD_MULTI : CARD_SINGLE); if (showingMultiCell) { setValueAction.putValue(Action.SHORT_DESCRIPTION, Vocab.TOOLTIP_SET_ALL_VALUES_FOR_SELECTED()); } else { setValueAction.putValue(Action.SHORT_DESCRIPTION, Vocab.ACTION_SET_VALUE()); } if (kdsmartSampleStatistics == null) { showStatsOption.setVisible(false); showStatsOption.setEnabled(false); } else { showStatsOption.setVisible(true); showStatsOption.setEnabled(true); } boolean showStats = showingMultiCell && showStatsOption.isSelected(); updateStatsControls(showStats); sampleValueTextField.requestFocusInWindow(); }
From source file:com.intuit.tank.tools.debugger.ActionProducer.java
/** * //from w w w . j a va 2 s .c o m * @return */ public Action getStartAction() { Action ret = actionMap.get(ACTION_START); if (ret == null) { ret = new AbstractAction(ACTION_START, getIcon("bug_go.png", IconSize.SMALL)) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { debuggerFrame.start(); } }; ret.putValue(Action.SHORT_DESCRIPTION, "Start debugging script."); actionMap.put(ACTION_START, ret); } return ret; }
From source file:ca.phon.app.project.ProjectWindow.java
private MultiActionButton createSessionButton() { MultiActionButton retVal = new MultiActionButton(); ImageIcon newIcn = IconManager.getInstance().getIcon("mimetypes/text-xml", IconSize.SMALL); String s1 = "Session"; String s2 = "Enter session name and press enter. Press escape to cancel."; retVal.getTopLabel().setText(WorkspaceTextStyler.toHeaderText(s1)); retVal.getTopLabel().setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); retVal.getTopLabel().setFont(FontPreferences.getTitleFont()); retVal.getTopLabel().setIcon(newIcn); retVal.setAlwaysDisplayActions(true); retVal.setOpaque(false);//from www .j a va2 s.co m ImageIcon cancelIcn = IconManager.getInstance().getIcon("actions/button_cancel", IconSize.SMALL); ImageIcon cancelIcnL = cancelIcn; PhonUIAction btnSwapAct = new PhonUIAction(this, "onSwapNewAndCreateSession", retVal); btnSwapAct.putValue(Action.ACTION_COMMAND_KEY, "CANCEL_CREATE_ITEM"); btnSwapAct.putValue(Action.NAME, "Cancel create"); btnSwapAct.putValue(Action.SHORT_DESCRIPTION, "Cancel create"); btnSwapAct.putValue(Action.SMALL_ICON, cancelIcn); btnSwapAct.putValue(Action.LARGE_ICON_KEY, cancelIcnL); retVal.addAction(btnSwapAct); JPanel sessionNamePanel = new JPanel(new BorderLayout()); sessionNamePanel.setOpaque(false); final JTextField sessionNameField = new JTextField(); sessionNameField.setDocument(new NameDocument()); sessionNameField.setText("Session Name"); sessionNamePanel.add(sessionNameField, BorderLayout.CENTER); ActionMap actionMap = retVal.getActionMap(); actionMap.put(btnSwapAct.getValue(Action.ACTION_COMMAND_KEY), btnSwapAct); InputMap inputMap = retVal.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); inputMap.put(ks, btnSwapAct.getValue(Action.ACTION_COMMAND_KEY)); retVal.setActionMap(actionMap); retVal.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap); PhonUIAction createNewSessionAct = new PhonUIAction(this, "onCreateSession", sessionNameField); createNewSessionAct.putValue(Action.SHORT_DESCRIPTION, "Create new session in selected corpus"); createNewSessionAct.putValue(Action.SMALL_ICON, IconManager.getInstance().getIcon("actions/list-add", IconSize.SMALL)); JButton createBtn = new JButton(createNewSessionAct); sessionNamePanel.add(createBtn, BorderLayout.EAST); sessionNameField.setAction(createNewSessionAct); // swap bottom component in new project button retVal.setBottomLabelText(WorkspaceTextStyler.toDescText(s2)); retVal.add(sessionNamePanel, BorderLayout.CENTER); retVal.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent e) { } @Override public void focusGained(FocusEvent e) { sessionNameField.requestFocus(); } }); return retVal; }