Hi to everybody!
Also I have another problem!
I want to add a third button to DefaultDialog.
public class MyDialog extends DefaultDialog implements ICommitDialog{
@Override
protected void buttonPressed(int buttonId) {
if (222== buttonId) {
showTaskSelectDialog(buttonId);
}
else {
if (frame.isVisible()) {
frame.setVisible(false);
frame.dispose();
}
super.buttonPressed(buttonId);
}
}
protected void createButtonsForButtonBar(Composite
parent) {
super.createButtonsForButtonBar(parent);
String[]
buttonLabels = getButtonLabels();
Button[]
buttons = new Button[buttonLabels.length +
1];
String[]
anotherLabels;
buttons[0]
= createButton(parent, 222 "Associate Issues", false);
for (int i = 0; i < buttonLabels.length; i++) {
buttons[i
+ 1] = getButton(i);
}
anotherLabels
= new String[buttonLabels.length +
1];
anotherLabels[0]
= "MY
New Button";
for (int i = 0; i < buttonLabels.length; i++) {
anotherLabels[i
+ 1] = buttonLabels[i];
}
super.setButtonLabels(anotherLabels);
super.setButtons(buttons);
}
}
So, in
method createButtonsForButtonBar
I changed the order of buttons. "MY New Button" must
be the first, and another buttons are placed after it. But when I launch this,
the order of buttons does not change.
Can anybody tell me what may
be the problem?
_________
With best regards,
Andrey Pavlenko