Java Code Examples for javax.swing.JLabel#setDisplayedMnemonicIndex()

The following examples show how to use javax.swing.JLabel#setDisplayedMnemonicIndex() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProxySettingsForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 2
Source File: ApplyLabelForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 3
Source File: MergeBranchForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 4
Source File: WorkspaceForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 5
Source File: CreateBranchForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 6
Source File: ImportForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 7
Source File: CreatePullRequestForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 8
Source File: CreateBranchForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 9
Source File: DeviceFlowResponsePromptForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 10
Source File: CheckoutForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 11
Source File: TfsLoginForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 12
Source File: FeedbackForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 13
Source File: VsoLoginForm.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
/**
 * @noinspection ALL
 */
private void $$$loadLabelText$$$(JLabel component, String text) {
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for (int i = 0; i < text.length(); i++) {
        if (text.charAt(i) == '&') {
            i++;
            if (i == text.length()) break;
            if (!haveMnemonic && text.charAt(i) != '&') {
                haveMnemonic = true;
                mnemonic = text.charAt(i);
                mnemonicIndex = result.length();
            }
        }
        result.append(text.charAt(i));
    }
    component.setText(result.toString());
    if (haveMnemonic) {
        component.setDisplayedMnemonic(mnemonic);
        component.setDisplayedMnemonicIndex(mnemonicIndex);
    }
}
 
Example 14
Source File: ImportedByPane.java    From attic-polygene-java with Apache License 2.0 5 votes vote down vote up
private void $$$loadLabelText$$$( JLabel component, String text )
{
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for( int i = 0; i < text.length(); i++ )
    {
        if( text.charAt( i ) == '&' )
        {
            i++;
            if( i == text.length() )
            {
                break;
            }
            if( !haveMnemonic && text.charAt( i ) != '&' )
            {
                haveMnemonic = true;
                mnemonic = text.charAt( i );
                mnemonicIndex = result.length();
            }
        }
        result.append( text.charAt( i ) );
    }
    component.setText( result.toString() );
    if( haveMnemonic )
    {
        component.setDisplayedMnemonic( mnemonic );
        component.setDisplayedMnemonicIndex( mnemonicIndex );
    }
}
 
Example 15
Source File: ServiceConfigurationPane.java    From attic-polygene-java with Apache License 2.0 5 votes vote down vote up
private void $$$loadLabelText$$$( JLabel component, String text )
{
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for( int i = 0; i < text.length(); i++ )
    {
        if( text.charAt( i ) == '&' )
        {
            i++;
            if( i == text.length() )
            {
                break;
            }
            if( !haveMnemonic && text.charAt( i ) != '&' )
            {
                haveMnemonic = true;
                mnemonic = text.charAt( i );
                mnemonicIndex = result.length();
            }
        }
        result.append( text.charAt( i ) );
    }
    component.setText( result.toString() );
    if( haveMnemonic )
    {
        component.setDisplayedMnemonic( mnemonic );
        component.setDisplayedMnemonicIndex( mnemonicIndex );
    }
}
 
Example 16
Source File: DependencyPane.java    From attic-polygene-java with Apache License 2.0 5 votes vote down vote up
private void $$$loadLabelText$$$( JLabel component, String text )
{
    StringBuffer result = new StringBuffer();
    boolean haveMnemonic = false;
    char mnemonic = '\0';
    int mnemonicIndex = -1;
    for( int i = 0; i < text.length(); i++ )
    {
        if( text.charAt( i ) == '&' )
        {
            i++;
            if( i == text.length() )
            {
                break;
            }
            if( !haveMnemonic && text.charAt( i ) != '&' )
            {
                haveMnemonic = true;
                mnemonic = text.charAt( i );
                mnemonicIndex = result.length();
            }
        }
        result.append( text.charAt( i ) );
    }
    component.setText( result.toString() );
    if( haveMnemonic )
    {
        component.setDisplayedMnemonic( mnemonic );
        component.setDisplayedMnemonicIndex( mnemonicIndex );
    }
}