/**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
// Attributes
// ------------------------------------------------------------------------
- /**
- * The dialog composite.
- */
- private Composite fDialogComposite;
-
/**
* A tree viewer for displaying and selection of available contexts.
*/
/**
* The contexts to add.
*/
- private final List<String> fSelectedContexts = new ArrayList<String>();
+ private final List<String> fSelectedContexts = new ArrayList<>();
// ------------------------------------------------------------------------
// Constructors
*/
public AddContextDialog(Shell shell) {
super(shell);
- setShellStyle(SWT.RESIZE);
+ setShellStyle(SWT.RESIZE | getShellStyle());
}
// ------------------------------------------------------------------------
@Override
public List<String> getContexts() {
- List<String> ret = new ArrayList<String>();
+ List<String> ret = new ArrayList<>();
ret.addAll(fSelectedContexts);
return ret;
}
protected Control createDialogArea(Composite parent) {
// Main dialog panel
- fDialogComposite = new Composite(parent, SWT.NONE);
+ Composite dialogComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, true);
- fDialogComposite.setLayout(layout);
- fDialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ dialogComposite.setLayout(layout);
+ dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
// Contexts list
- Group contextGroup = new Group(fDialogComposite, SWT.SHADOW_NONE);
+ Group contextGroup = new Group(dialogComposite, SWT.SHADOW_NONE);
contextGroup.setText(Messages.TraceControl_AddContextAvailableContextsLabel);
layout = new GridLayout(1, true);
contextGroup.setLayout(layout);
getShell().setMinimumSize(new Point(500, 450));
- return fDialogComposite;
+ return dialogComposite;
}
@Override
* The contexts to set
*/
public void setAvalibleContexts(List<String> contexts) {
- fAvailableContexts = new ArrayList<Context>();
+ fAvailableContexts = new ArrayList<>();
if (contexts != null) {
for (Iterator<String> iterator = contexts.iterator(); iterator.hasNext();) {
String name = iterator.next();
/**
* @return The name of this component
*/
- public String getName();
+ String getName();
/**
* @return The parent component
*/
- public Object getParent();
+ Object getParent();
/**
* @return The array of children of this component
*/
- public Object[] getChildren();
+ Object[] getChildren();
/**
* @return If this component has children or not
*/
- public boolean hasChildren();
+ boolean hasChildren();
}
}