/** * @see Dialog#createButtonBar(Composite) */ protected void createButtonsForButtonBar(Composite parent) { final String[] buttonLabels = getButtonLabels(); final Button[] buttons = new Button[buttonLabels.length]; final int defaultButtonIndex = getDefaultButtonIndex(); int suggestedId = IDialogConstants.INTERNAL_ID; for (int i = 0; i < buttonLabels.length; i++) { String label = buttonLabels[i]; // get the JFace button ID that matches the label, or use the specified // id if there is no match. int id = mapButtonLabelToButtonID(label, suggestedId); // if the suggested id was used, increment the default for next use if (id == suggestedId) { suggestedId++; } Button button = createButton(parent, id, label, defaultButtonIndex == i); buttons[i] = button; } setButtons(buttons); }
/** * @see Dialog#createButtonBar(Composite) */ @Override protected void createButtonsForButtonBar(Composite parent) { final String[] buttonLabels = getButtonLabels(); final Button[] buttons = new Button[buttonLabels.length]; final int defaultButtonIndex = getDefaultButtonIndex(); int suggestedId = IDialogConstants.INTERNAL_ID; for (int i = 0; i < buttonLabels.length; i++) { String label = buttonLabels[i]; // get the JFace button ID that matches the label, or use the specified // id if there is no match. int id = mapButtonLabelToButtonID(label, suggestedId); // if the suggested id was used, increment the default for next use if (id == suggestedId) { suggestedId++; } Button button = createButton(parent, id, label, defaultButtonIndex == i); buttons[i] = button; } setButtons(buttons); }
/** * @see Dialog#createButtonBar(Composite) */ @Override protected void createButtonsForButtonBar(Composite parent) { final String[] buttonLabels = getButtonLabels(); final Button[] buttons = new Button[buttonLabels.length]; final int defaultButtonIndex = getDefaultButtonIndex(); int suggestedId = IDialogConstants.INTERNAL_ID; for (int i = 0; i < buttonLabels.length; i++) { String label = buttonLabels[i]; // get the JFace button ID that matches the label, or use the specified // id if there is no match. int id = mapButtonLabelToButtonID(label, suggestedId); // if the suggested id was used, increment the default for next use if (id == suggestedId) { suggestedId++; } Button button = createButton(parent, id, label, defaultButtonIndex == i); buttons[i] = button; } setButtons(buttons); }