Lines 70-75
Link Here
|
70 |
private String message = ""; //$NON-NLS-1$ |
70 |
private String message = ""; //$NON-NLS-1$ |
71 |
private String errorMessage; |
71 |
private String errorMessage; |
72 |
private Text messageLabel; |
72 |
private Text messageLabel; |
|
|
73 |
private Composite workArea; |
73 |
|
74 |
|
74 |
private Label messageImageLabel; |
75 |
private Label messageImageLabel; |
75 |
private Image messageImage; |
76 |
private Image messageImage; |
Lines 105-134
Link Here
|
105 |
parent.setLayoutData(data); |
106 |
parent.setLayoutData(data); |
106 |
|
107 |
|
107 |
//Now create a work area for the rest of the dialog |
108 |
//Now create a work area for the rest of the dialog |
108 |
Composite composite = new Composite(parent, SWT.NULL); |
109 |
workArea = new Composite(parent, SWT.NULL); |
109 |
GridLayout childLayout = new GridLayout(); |
110 |
GridLayout childLayout = new GridLayout(); |
110 |
childLayout.marginHeight = 0; |
111 |
childLayout.marginHeight = 0; |
111 |
childLayout.marginWidth = 0; |
112 |
childLayout.marginWidth = 0; |
112 |
childLayout.verticalSpacing = 0; |
113 |
childLayout.verticalSpacing = 0; |
113 |
composite.setLayout(childLayout); |
114 |
workArea.setLayout(childLayout); |
114 |
|
115 |
|
115 |
Control top = createTitleArea(parent); |
116 |
Control top = createTitleArea(parent); |
116 |
|
117 |
|
117 |
FormData childData = new FormData(); |
118 |
resetWorkAreaAttachments(top); |
118 |
childData.top = new FormAttachment(top); |
|
|
119 |
childData.right = new FormAttachment(100,0); |
120 |
childData.left = new FormAttachment(0,0); |
121 |
childData.bottom = new FormAttachment(100,0); |
122 |
composite.setLayoutData(childData); |
123 |
|
119 |
|
124 |
composite.setFont(JFaceResources.getDialogFont()); |
120 |
workArea.setFont(JFaceResources.getDialogFont()); |
125 |
|
121 |
|
126 |
// initialize the dialog units |
122 |
// initialize the dialog units |
127 |
initializeDialogUnits(composite); |
123 |
initializeDialogUnits(workArea); |
128 |
|
124 |
|
129 |
// create the dialog area and button bar |
125 |
// create the dialog area and button bar |
130 |
dialogArea = createDialogArea(composite); |
126 |
dialogArea = createDialogArea(workArea); |
131 |
buttonBar = createButtonBar(composite); |
127 |
buttonBar = createButtonBar(workArea); |
132 |
|
128 |
|
133 |
return parent; |
129 |
return parent; |
134 |
} |
130 |
} |
Lines 582-587
Link Here
|
582 |
public void setTitleImage(Image newTitleImage) { |
578 |
public void setTitleImage(Image newTitleImage) { |
583 |
titleImage.setImage(newTitleImage); |
579 |
titleImage.setImage(newTitleImage); |
584 |
titleImage.setVisible(newTitleImage != null); |
580 |
titleImage.setVisible(newTitleImage != null); |
|
|
581 |
if(newTitleImage != null){ |
582 |
determineTitleImageLargest(); |
583 |
Control top; |
584 |
if(titleImageLargest) |
585 |
top = titleImage; |
586 |
else |
587 |
top = messageLabel; |
588 |
resetWorkAreaAttachments(top); |
589 |
} |
585 |
} |
590 |
} |
586 |
|
591 |
|
587 |
/** |
592 |
/** |
Lines 611-616
Link Here
|
611 |
messageImageLabel.setBackground(color); |
616 |
messageImageLabel.setBackground(color); |
612 |
bottomFillerLabel.setBackground(color); |
617 |
bottomFillerLabel.setBackground(color); |
613 |
leftFillerLabel.setBackground(color); |
618 |
leftFillerLabel.setBackground(color); |
|
|
619 |
} |
620 |
|
621 |
/** |
622 |
* Reset the attachment of the workArea to now attach |
623 |
* to top as the top control. |
624 |
* @param top |
625 |
*/ |
626 |
private void resetWorkAreaAttachments(Control top) { |
627 |
FormData childData = new FormData(); |
628 |
childData.top = new FormAttachment(top); |
629 |
childData.right = new FormAttachment(100, 0); |
630 |
childData.left = new FormAttachment(0, 0); |
631 |
childData.bottom = new FormAttachment(100, 0); |
632 |
workArea.setLayoutData(childData); |
614 |
} |
633 |
} |
615 |
|
634 |
|
616 |
} |
635 |
} |