in plugin/src/software/aws/toolkits/eclipse/amazonq/views/FeedbackDialog.java [284:378]
private void createProductFeedbackQuestion(final Composite questionsContainer) {
createLabel(questionsContainer, "What do you like about Amazon Q for Eclipse? What can we improve?");
Composite commentComposite = new Composite(questionsContainer, SWT.BORDER);
StackLayout stackLayout = new StackLayout();
commentComposite.setLayout(stackLayout);
GridData commentCompositeLayout = new GridData();
commentCompositeLayout.horizontalAlignment = SWT.FILL;
commentCompositeLayout.verticalAlignment = SWT.FILL;
commentCompositeLayout.grabExcessHorizontalSpace = true;
commentCompositeLayout.grabExcessVerticalSpace = false;
commentCompositeLayout.heightHint = 150;
commentCompositeLayout.verticalIndent = 5;
commentComposite.setLayoutData(commentCompositeLayout);
Composite commentWrapper = new Composite(commentComposite, SWT.NONE);
GridLayout commentWrapperLayout = new GridLayout(1, false);
commentWrapperLayout.marginTop = 1;
commentWrapperLayout.marginLeft = 1;
commentWrapper.setLayout(commentWrapperLayout);
commentWrapper.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
commentWrapper.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
commentBox = new Text(commentWrapper, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
commentBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Composite labelWrapper = new Composite(commentComposite, SWT.NONE);
GridLayout labelWrapperLayout = new GridLayout(1, false);
labelWrapperLayout.marginTop = 1;
labelWrapperLayout.marginLeft = 1;
labelWrapper.setLayout(labelWrapperLayout);
labelWrapper.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
labelWrapper.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Label ghostLabel = new Label(labelWrapper, SWT.NONE);
ghostLabel.setText("(Optional)");
ghostLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
ghostLabel.addPaintListener(new PaintListener() {
@Override
public void paintControl(final PaintEvent event) {
ghostLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
});
stackLayout.topControl = labelWrapper;
labelWrapper.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(final MouseEvent e) {
isCommentQuestionGhostLabelVisible = false;
stackLayout.topControl = commentWrapper;
commentBox.setFocus();
commentComposite.layout();
}
});
commentBox.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent event) {
if (commentBox.getText().isEmpty()) {
isCommentQuestionGhostLabelVisible = true;
} else {
isCommentQuestionGhostLabelVisible = false;
}
commentComposite.redraw();
commentComposite.layout(true, true);
handleTextModified(event);
}
});
commentComposite.addPaintListener(new PaintListener() {
@Override
public void paintControl(final PaintEvent event) {
if (isCommentQuestionGhostLabelVisible) {
stackLayout.topControl = labelWrapper;
} else {
stackLayout.topControl = commentWrapper;
}
commentComposite.layout();
}
});
characterRemainingLabel = new Label(questionsContainer, SWT.NONE);
characterRemainingLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
updateCharacterRemainingCount();
createLabel(questionsContainer,
"Don't add personally identifiable information (PII), confidential or sensitive "
+ "information in your feedback.");
createLabel(questionsContainer,
"Please remove any PII when sharing file paths, error messages, etc.");
}