Skip to content

Commit

Permalink
checkstyle edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Borges committed Jan 28, 2025
1 parent a053f7e commit 8ac51f0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import software.aws.toolkits.eclipse.amazonq.views.router.ViewId;


public class AmazonQViewContainer extends ViewPart implements EventObserver<ViewId> {
public final class AmazonQViewContainer extends ViewPart implements EventObserver<ViewId> {
private Composite parentComposite;
private StackLayout layout;
private Map<ViewId, BaseAmazonQView> views;
Expand All @@ -44,7 +44,7 @@ public AmazonQViewContainer() {
* 2. viewContainer.init(currentView)
*/

public void initializeViews(ViewId currentActiveViewId) {
public void initializeViews(final ViewId currentActiveViewId) {

//init map containing all views
var dependencyMissingView = new DependencyMissingView();
Expand All @@ -60,7 +60,7 @@ public void initializeViews(ViewId currentActiveViewId) {
activeView = views.get(currentActiveViewId);
}

public final void createPartControl(final Composite parent) {
public void createPartControl(final Composite parent) {
parentComposite = parent;
layout = new StackLayout();
parent.setLayout(layout);
Expand All @@ -86,7 +86,7 @@ private void setupStaticMenuActions() {
new AmazonQStaticActions(getViewSite());
}

private void updateChildView(BaseAmazonQView newView, ViewId newViewId) {
private void updateChildView(final BaseAmazonQView newView, final ViewId newViewId) {
Display.getDefault().asyncExec(() -> {

if (activeView != null) {
Expand Down Expand Up @@ -123,7 +123,7 @@ public void onEvent(final ViewId newViewId) {
}

@Override
public final void setFocus() {
public void setFocus() {
parentComposite.setFocus();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.eclipse.swt.widgets.Composite;

public interface BaseAmazonQView {
public Composite setupView(Composite parentComposite);
public boolean canDisplay();
public void dispose();
Composite setupView(Composite parentComposite);
boolean canDisplay();
void dispose();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ public abstract class CallToActionView implements BaseAmazonQView {
private String buttonLabel;
private SelectionListener buttonHandler;

private final String ICON_PATH = getIconPath();
private final String HEADER_LABEL = getHeaderLabel();
private final String DETAIL_MESSAGE = getDetailMessage();
private final String iconPath = getIconPath();
private final String headerLabel = getHeaderLabel();
private final String detailMessage = getDetailMessage();
private Image icon;

protected abstract String getButtonLabel();
protected abstract SelectionListener getButtonHandler();
protected abstract void setupButtonFooterContent(Composite composite);

@Override
public Composite setupView(Composite parentComposite) {
public final Composite setupView(final Composite parentComposite) {
Composite container = new Composite(parentComposite, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
layout.marginWidth = 10;
Expand All @@ -44,7 +44,7 @@ public Composite setupView(Composite parentComposite) {
container.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));

Label iconLabel = new Label(container, SWT.NONE);
icon = loadImage(ICON_PATH);
icon = loadImage(iconPath);
if (icon != null) {
iconLabel.setImage(icon);
iconLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
Expand All @@ -56,12 +56,12 @@ public Composite setupView(Composite parentComposite) {
});
}

Label headerLabel = new Label(container, SWT.CENTER | SWT.WRAP);
headerLabel.setText(HEADER_LABEL);
headerLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
Label header = new Label(container, SWT.CENTER | SWT.WRAP);
header.setText(headerLabel);
header.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

Label detailLabel = new Label(container, SWT.CENTER | SWT.WRAP);
detailLabel.setText(DETAIL_MESSAGE);
detailLabel.setText(detailMessage);
detailLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

this.buttonLabel = getButtonLabel();
Expand Down Expand Up @@ -109,22 +109,14 @@ public void dispose() {
// Default implementation - subclasses can override if they need to dispose of resources
}

@SuppressWarnings("DesignForExtension")
@Override
public boolean canDisplay() {
// Default implementation - subclasses should override to provide specific display logic
return true;
}
protected String getIconPath() {
// TODO Auto-generated method stub
return null;
}
protected String getHeaderLabel() {
// TODO Auto-generated method stub
return null;
}
protected String getDetailMessage() {
// TODO Auto-generated method stub
return null;
}
protected abstract String getIconPath();
protected abstract String getHeaderLabel();
protected abstract String getDetailMessage();

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ChatAssetMissingView() {
}

@Override
public Composite setupView(Composite parentComposite) {
public Composite setupView(final Composite parentComposite) {
container = new Composite(parentComposite, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
layout.marginWidth = 20;
Expand Down

0 comments on commit 8ac51f0

Please sign in to comment.