@Override protected String getStatusFieldText() { KeySequence[] sequences= getInvokingCommandKeySequences(); String keyName= ""; //$NON-NLS-1$ if (sequences != null && sequences.length > 0) keyName= sequences[0].format(); if (fOtherContentProvider instanceof TraditionalHierarchyContentProvider) { return Messages.format(TypeHierarchyMessages.HierarchyInformationControl_toggle_traditionalhierarchy_label, keyName); } else { return Messages.format(TypeHierarchyMessages.HierarchyInformationControl_toggle_superhierarchy_label, keyName); } }
/** * {@inheritDoc} */ @Override protected String getStatusFieldText() { KeySequence[] sequences= getInvokingCommandKeySequences(); if (sequences == null || sequences.length == 0) return ""; //$NON-NLS-1$ String keySequence= sequences[0].format(); if (fOutlineContentProvider.isShowingInheritedMembers()) return Messages.format(JavaUIMessages.JavaOutlineControl_statusFieldText_hideInheritedMembers, keySequence); else return Messages.format(JavaUIMessages.JavaOutlineControl_statusFieldText_showInheritedMembers, keySequence); }
final protected KeySequence[] getInvokingCommandKeySequences() { if (fInvokingCommandKeySequences == null) { if (getInvokingCommand() != null) { List<IKeySequenceBinding> list= getInvokingCommand().getKeySequenceBindings(); if (!list.isEmpty()) { fInvokingCommandKeySequences= new KeySequence[list.size()]; for (int i= 0; i < fInvokingCommandKeySequences.length; i++) { fInvokingCommandKeySequences[i]= list.get(i).getKeySequence(); } return fInvokingCommandKeySequences; } } } return fInvokingCommandKeySequences; }
/** * Finds all of the commands which have key bindings that start with the * given key sequence. * * @param keySequence * The prefix to look for; must not be <code>null</code>. * @return A map of all of the matching key sequences ( * <code>KeySequence</code>) to command identifiers ( * <code>String</code>). This map may be empty, but it is never * <code>null</code>. */ Map getPartialMatches(KeySequence keySequence);
/** * Finds the command which has the given key sequence as one of its key * bindings. * * @param keySequence * The key binding to look for; must not be <code>null</code>. * @return The command id for the matching command, if any; * <code>null</code> if none. */ String getPerfectMatch(KeySequence keySequence);
/** * Checks to see whether there are any commands which have key bindings that * start with the given key sequence. * * @param keySequence * The prefix to look for; must not be <code>null</code>. * @return <code>true</code> if at least one command has a key binding that * starts with <code>keySequence</code>;<code>false</code> * otherwise. */ boolean isPartialMatch(KeySequence keySequence);
/** * Checks to see if there is a command with the given key sequence as one of * its key bindings. * * @param keySequence * The key binding to look for; must not be <code>null</code>. * @return <code>true</code> if a command has a matching key binding; * <code>false</code> otherwise. */ boolean isPerfectMatch(KeySequence keySequence);