Java Code Examples for org.eclipse.swt.SWT#SHADOW_NONE

The following examples show how to use org.eclipse.swt.SWT#SHADOW_NONE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BibtexMergeDialog.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildFilesPart(Composite container) {
	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.horizontalSpan = 1;
	gridData.verticalSpan = 1;

	Group group = new Group(container, SWT.SHADOW_NONE);
	group.setText("Files to merge");
	group.setLayout(new FillLayout());
	group.setLayoutData(gridData);

	Label label = new Label(group, SWT.NONE);
	label.setText(mergeData.getResourceList().stream()
			.map(resource -> resource.getURI().toString() + ":\t" + resource.getContents().size() + " entries")
			.collect(Collectors.joining("\n")));
}
 
Example 2
Source File: CPythonScriptExecutorDialog.java    From pentaho-cpython-plugin with Apache License 2.0 6 votes vote down vote up
private void addOptionsGroup() {
  // add second group
  wgOptions = new Group( wcConfig, SWT.SHADOW_NONE );
  props.setLook( wgOptions );
  wgOptions.setText( BaseMessages.getString( PKG, "CPythonScriptExecutorDialog.ConfigTab.OptionsGroup" ) );
  FormLayout optionsGroupLayout = new FormLayout();
  optionsGroupLayout.marginWidth = 10;
  optionsGroupLayout.marginHeight = 10;
  wgOptions.setLayout( optionsGroupLayout );
  FormData fd = new FormData();
  fd.left = new FormAttachment( 0, 0 );
  fd.right = new FormAttachment( 100, 0 );
  fd.top = new FormAttachment( wgRowHandling, MARGIN );
  wgOptions.setLayoutData( fd );

  addIncludeInputInOutputControllers();
}
 
Example 3
Source File: MailInputDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private Group createGroup( Composite parentTab, Control top, String label ) {
  Group group = new Group( parentTab, SWT.SHADOW_NONE );
  props.setLook( group );
  group.setText( label );

  FormLayout groupLayout = new FormLayout();
  groupLayout.marginWidth = 10;
  groupLayout.marginHeight = 10;
  group.setLayout( groupLayout );

  FormData fdGroup = new FormData();
  fdGroup.left = new FormAttachment( 0, props.getMargin() );
  fdGroup.top = new FormAttachment( top, props.getMargin() );
  fdGroup.right = new FormAttachment( 100, -props.getMargin() );
  group.setLayoutData( fdGroup );

  return group;
}
 
Example 4
Source File: AccordionLabel.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Check the style bits to ensure that no invalid styles are applied.
 */
private static int checkStyle( int style )
{
	if ( ( style & SWT.BORDER ) != 0 )
		style |= SWT.SHADOW_IN;
	int mask = SWT.SHADOW_IN
			| SWT.SHADOW_OUT
			| SWT.SHADOW_NONE
			| SWT.LEFT_TO_RIGHT
			| SWT.RIGHT_TO_LEFT;
	style = style & mask;
	return style |= SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED;
}
 
Example 5
Source File: CodeAssistConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected Composite createSubsection(Composite parent, String label) {
	Group group= new Group(parent, SWT.SHADOW_NONE);
	group.setText(label);
	GridData data= new GridData(SWT.FILL, SWT.CENTER, true, false);
	group.setLayoutData(data);
	GridLayout layout= new GridLayout();
	layout.numColumns= 3;
	group.setLayout(layout);

	return group;
}
 
Example 6
Source File: AbstractConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected Composite createSubsection(Composite parent, SectionManager manager, String label) {
	if (manager != null) {
		return manager.createSection(label);
	} else {
		Group group= new Group(parent, SWT.SHADOW_NONE);
		group.setText(label);
		GridData data= new GridData(SWT.FILL, SWT.CENTER, true, false);
		group.setLayoutData(data);
		return group;
	}
}
 
Example 7
Source File: ComponentStatusLabel.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Checkstyle method.
 *
 * @param style
 * @return
 */
private static int checkStyle(int style) {
    if ((style & SWT.BORDER) != 0) style |= SWT.SHADOW_IN;
    int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
    style = style & mask;
    return style |= SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED;
}
 
Example 8
Source File: AddContextDialog.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {

    // Main dialog panel
    Composite dialogComposite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, true);
    dialogComposite.setLayout(layout);
    dialogComposite.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Contexts list
    Group contextGroup = new Group(dialogComposite, SWT.SHADOW_NONE);
    contextGroup.setText(Messages.TraceControl_AddContextAvailableContextsLabel);
    layout = new GridLayout(1, true);
    contextGroup.setLayout(layout);
    contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH));

    fContextsViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    fContextsViewer.getTree().setToolTipText(Messages.TraceControl_AddContextAvailableContextsTooltip);

    fContextsViewer.setContentProvider(new ContextsContentProvider());
    fContextsViewer.setLabelProvider(new ContextsLabelProvider());
    fContextsViewer.addCheckStateListener(new ContextCheckListener());
    fContextsViewer.setInput(fContextModel);
    fContextsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));

    getShell().setMinimumSize(new Point(500, 450));

    return dialogComposite;
}
 
Example 9
Source File: CustomSeparator.java    From http4e with Apache License 2.0 5 votes vote down vote up
private static int checkStyle( int style){
   int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.HORIZONTAL | SWT.VERTICAL;
   style &= mask;
   if ((style & (SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE)) == 0)
      style |= SWT.SHADOW_IN;
   if ((style & (SWT.HORIZONTAL | SWT.VERTICAL)) == 0)
      style |= SWT.VERTICAL;
   return style;
}
 
Example 10
Source File: LiveSashForm.java    From http4e with Apache License 2.0 5 votes vote down vote up
/**
 * Set the border for a child control.
 * 
 * @param child The child control for which to set the border.
 * @param shadow One of the SWT shadow constants SHADOW_IN, SHADOW_OUT,
 *   SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_NONE.
 */  

public void setChildBorder(Control child, int shadow)
{
  checkWidget();
  if(child == null) return;
  if(shadow == SWT.SHADOW_NONE) child.setData(CHILD_SHADOW, null);
  else child.setData(CHILD_SHADOW, new Integer(shadow));
  layout();
  redraw();
  //weightsChanged();
}
 
Example 11
Source File: LiveSashForm.java    From http4e with Apache License 2.0 5 votes vote down vote up
private void drawBorderAround(Control c, GC gc)
{
  int sh = getChildBorder(c);
  if(sh == SWT.SHADOW_NONE) return;

  Display disp = getDisplay();
  Color shadow = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
  Color highlight = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
  if(shadow == null || highlight == null) return;
  Rectangle r = c.getBounds();

  switch(sh)
  {
    case SWT.SHADOW_IN:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, shadow, highlight);
      break;

    case SWT.SHADOW_OUT:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, highlight, shadow);
      break;

    case SWT.SHADOW_ETCHED_IN:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, highlight, shadow);
      drawBevelRect(gc, r.x-2, r.y-2, r.width+3, r.height+3, shadow, highlight);
      break;

    case SWT.SHADOW_ETCHED_OUT:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, shadow, highlight);
      drawBevelRect(gc, r.x-2, r.y-2, r.width+3, r.height+3, highlight, shadow);
      break;
  }
}
 
Example 12
Source File: WizardComponentUtils.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/** Horizontal line separator */
public static Control insertHorizontalSeparator(Composite parent) {
	Label label = new Label(parent, SWT.SEPARATOR | SWT.WRAP | SWT.HORIZONTAL | SWT.SHADOW_NONE);
	GridData separatorLayoutData = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
	separatorLayoutData.heightHint = 25;
	label.setLayoutData(separatorLayoutData);
	return label;
}
 
Example 13
Source File: MonthCalendarableItemControl.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Check the style bits to ensure that no invalid styles are applied.
 */
private static int checkStyle (int style) {
	if ((style & SWT.BORDER) != 0) style |= SWT.SHADOW_IN;
	int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
	style = style & mask;
	return style |= SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED;
}
 
Example 14
Source File: ExecutionStatisticsDialog.java    From tlaplus with MIT License 4 votes vote down vote up
@Override
  protected Control createCustomArea(Composite parent) {
final Composite c = new Composite(parent, SWT.BORDER);
c.setLayout(new GridLayout());
c.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

//NOTE: Take care of ExecutionStatisticsCollector.md when updating!!!
final String txt = String.format("%s"
		+ "* Total number of cores and cores assigned to TLC\n"
		+ "* Heap and off-heap memory allocated to TLC\n"
		+ "* TLC's version (git commit SHA)\n"
		+ "* If breadth-first search, depth-first search or simulation mode is active\n"
		+ "* TLC's implementation for the sets of seen and unseen states\n"
		+ "* If TLC has been launched from the TLA Toolbox\n"
		+ "* Name, version, and architecture of your operating system\n"
		+ "* Vendor, version, and architecture of your Java virtual machine\n"
		+ "* The current date and time\n"
		+ "* An installation identifier which allows us to group execution statistics\n\n"
		+ "The execution statistics do not contain personal information. If you wish to revoke\n"
		+ "your consent to share execution statistics at a later point, please chose \n"
		+ "\"Never Share Execution Statistics\" below by re-opening this dialog via\n"
		+ "Help > Opt In/Out Execution Statistics accessible from the Toolbox's main menu.", prettyPrintSelection2(esc));

final StyledText st = new StyledText(c, SWT.SHADOW_NONE | SWT.WRAP);
st.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

st.setEnabled(true);
st.setEditable(false);
st.setText(txt);

final StyleRange[] ranges = new StyleRange[3];
ranges[0] = new StyleRange(txt.indexOf("(TLC) execution statistics"), "(TLC) execution statistics".length(), null, null);
ranges[0].underline = true;
ranges[0].underlineStyle = SWT.UNDERLINE_LINK;
ranges[0].data = "https://exec-stats.tlapl.us";

ranges[1] = new StyleRange(txt.indexOf("publicly available"), "publicly available".length(), null, null);
ranges[1].underline = true;
ranges[1].underlineStyle = SWT.UNDERLINE_LINK;
ranges[1].data = "https://exec-stats.tlapl.us/tlaplus.csv";
		
ranges[2] = new StyleRange(txt.indexOf("git commit SHA"), "git commit SHA".length(), null, null);
ranges[2].underline = true;
ranges[2].underlineStyle = SWT.UNDERLINE_LINK;
ranges[2].data = "https://git-scm.com/book/en/v2/Git-Internals-Git-Objects";

st.setStyleRanges(ranges);
st.addMouseListener(new MouseAdapter() {
	@Override
	public void mouseUp(final MouseEvent event) {
              final int offset = st.getOffsetAtPoint(new Point(event.x, event.y));
              if (offset < 0 || offset >= st.getCharCount()) {
              	return;
              }
		final StyleRange style = st.getStyleRangeAtOffset(offset);
              if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK && style.data instanceof String) {
                  try {
				PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL((String) style.data));
			} catch (PartInitException | MalformedURLException notExpectedToHappen) {
				notExpectedToHappen.printStackTrace();
			}
              }
	}
});
	
      return c;
  }
 
Example 15
Source File: ElasticSearchBulkDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void fillIndexGroup( Composite parentTab ) {
  wIndexGroup = new Group( parentTab, SWT.SHADOW_NONE );
  props.setLook( wIndexGroup );
  wIndexGroup.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.IndexGroup.Label" ) );

  FormLayout indexGroupLayout = new FormLayout();
  indexGroupLayout.marginWidth = 10;
  indexGroupLayout.marginHeight = 10;
  wIndexGroup.setLayout( indexGroupLayout );

  // Index
  wIndex = new LabelTextVar( transMeta, wIndexGroup, BaseMessages.getString( PKG, "ElasticSearchBulkDialog.Index"
          + ".Label" ), BaseMessages.getString( PKG, "ElasticSearchBulkDialog.Index.Tooltip" ) );
  wIndex.addModifyListener( lsMod );

  // Type
  wType =
          new LabelTextVar( transMeta, wIndexGroup, BaseMessages.getString( PKG, "ElasticSearchBulkDialog.Type"
                  + ".Label" ),
                  BaseMessages.getString( PKG, "ElasticSearchBulkDialog.Type.Tooltip" ) );
  wType.addModifyListener( lsMod );

  // Test button
  wTest = new Button( wIndexGroup, SWT.PUSH );
  wTest.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.TestIndex.Label" ) );
  wTest.setToolTipText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.TestIndex.Tooltip" ) );

  wTest.addListener( SWT.Selection, new Listener() {

    public void handleEvent( Event arg0 ) {
      test( TestType.INDEX );
    }
  } );

  Control[] connectionControls = new Control[]{wIndex, wType};
  placeControls( wIndexGroup, connectionControls );

  BaseStepDialog.positionBottomButtons( wIndexGroup, new Button[]{wTest}, Const.MARGIN, wType );

  fdIndexGroup = new FormData();
  fdIndexGroup.left = new FormAttachment( 0, Const.MARGIN );
  fdIndexGroup.top = new FormAttachment( wStepname, Const.MARGIN );
  fdIndexGroup.right = new FormAttachment( 100, -Const.MARGIN );
  wIndexGroup.setLayoutData( fdIndexGroup );
}
 
Example 16
Source File: SDViewerPage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    parent.setLayout(gl);
    Composite page = new Composite(parent, SWT.NONE);
    GridLayout pageLayout = new GridLayout();
    pageLayout.numColumns = 2;
    GridData pageLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    page.setLayoutData(pageLayoutdata);
    page.setLayout(pageLayout);

    fTooltip = new BooleanFieldEditor(ISDPreferences.PREF_TOOLTIP, Messages.SequenceDiagram_ShowTooltips, page);
    fTooltip.setPreferenceStore(fPreferences.getPreferenceStore());
    fTooltip.load();

    // link font with zoom pref
    fLink = new BooleanFieldEditor(ISDPreferences.PREF_LINK_FONT, Messages.SequenceDiagram_IncreaseFontSizeWhenZooming, page);
    fLink.setPreferenceStore(fPreferences.getPreferenceStore());
    fLink.load();

    fNoExternalTime = new BooleanFieldEditor(ISDPreferences.PREF_EXCLUDE_EXTERNAL_TIME, Messages.SequenceDiagram_ExcludeExternalTime, page);
    fNoExternalTime.setPreferenceStore(fPreferences.getPreferenceStore());
    fNoExternalTime.load();

    // use gradient color pref
    fUseGrad = new BooleanFieldEditor(ISDPreferences.PREF_USE_GRADIENT, Messages.SequenceDiagram_UseGradientColor, page);
    fUseGrad.setPreferenceStore(fPreferences.getPreferenceStore());
    fUseGrad.load();

    Label separator = new Label(page, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    GridData sepData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    separator.setLayoutData(sepData);

    Composite prefPage = new Composite(page, SWT.NONE);
    GridLayout prefPageLayout = new GridLayout();
    prefPage.setLayoutData(pageLayoutdata);
    prefPageLayout.numColumns = 1;
    prefPage.setLayout(prefPageLayout);

    // swimLane width pref
    fLifelineWidth = new IntegerFieldEditor(ISDPreferences.PREF_LIFELINE_WIDTH, Messages.SequenceDiagram_LifelineWidth, prefPage);
    fLifelineWidth.setPreferenceStore(fPreferences.getPreferenceStore());
    fLifelineWidth.setValidRange(119, 500);
    fLifelineWidth.load();

    // not very nice
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);

    // Font list pref
    fClassItemList = new List(prefPage, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData tabItemLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fClassItemList.setLayoutData(tabItemLayoutdata);

    String[] fontList2 = SDViewPref.getFontList2();
    for (int i = 0; i < fontList2.length; i++) {
        fClassItemList.add(fontList2[i]);
    }
    fClassItemList.setSelection(0);
    fClassItemList.addSelectionListener(this);
    fButtonArea = new Composite(prefPage, SWT.NONE);
    GridData tabItemLayoutdata2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL/* |GridData.GRAB_HORIZONTAL */| GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fButtonArea.setLayoutData(tabItemLayoutdata2);
    GridLayout buttonAreaLayout = new GridLayout();
    buttonAreaLayout.numColumns = 1;
    fButtonArea.setLayout(buttonAreaLayout);

    // font selector initialise for the lifeline font pref
    String[] fontList = SDViewPref.getFontList();
    fFont = new FontFieldEditor(fontList[0], "",//$NON-NLS-1$
            Messages.SequenceDiagram_AaBbYyZz, fButtonArea);
    fFont.getPreviewControl().setSize(500, 500);
    fFont.setPreferenceStore(fPreferences.getPreferenceStore());
    fFont.load();

    fBackGroundColor = new ColorFieldEditor(fontList[0] + SDViewPref.BACK_COLOR_POSTFIX, Messages.SequenceDiagram_Background, fButtonArea);
    fBackGroundColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fBackGroundColor.load();

    fLineColor = new ColorFieldEditor(fontList[0] + SDViewPref.FORE_COLOR_POSTFIX, Messages.SequenceDiagram_Lines, fButtonArea);
    fLineColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fLineColor.load();

    fTextColor = new ColorFieldEditor(fontList[0] + SDViewPref.TEXT_COLOR_POSTFIX, Messages.SequenceDiagram_Text, fButtonArea);
    fTextColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fTextColor.load();
    swapPref(true);
    Dialog.applyDialogFont(page);

    return page;
}
 
Example 17
Source File: XLIFFEditorStatusLineItem.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
public void fill(Composite parent) {
		statusLine = parent;
		new Label(parent, SWT.SEPARATOR);
		
		Composite container = new Composite(parent, SWT.NONE);		
		GridLayout gl = new GridLayout(1, false);
		gl.marginWidth = 0;
		gl.marginHeight = 0;
		gl.marginTop = 0;
		gl.marginRight = 0;
		gl.marginBottom = 0;
		container.setLayout(gl);
		
		label = new Label(container, SWT.SHADOW_NONE);	
		label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true, 1, 1));
		label.setAlignment(SWT.CENTER);
		label.setText(text);
		if (image != null) {
			label.setImage(image);
			label.setToolTipText(text);
		}

//		Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
//		int widthHint = preferredSize.x;
//		int heightHint = preferredSize.y;
//		if (widthHint < 0) {
//			// Compute the size base on 'charWidth' average char widths
//			GC gc = new GC(statusLine);
//			gc.setFont(statusLine.getFont());
//			FontMetrics fm = gc.getFontMetrics();
//			widthHint = fm.getAverageCharWidth() * 40;
//			heightHint = fm.getHeight();
//			gc.dispose();
//		}
		
//		StatusLineLayoutData data = new StatusLineLayoutData();
//		data.widthHint = widthHint;
//		label.setLayoutData(data);
		
//		StatusLineLayoutData data = new StatusLineLayoutData();
//		data.heightHint = heightHint;
//		speLb.setLayoutData(data);
	}
 
Example 18
Source File: N4IDEXpectView.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void createPartControl(Composite parent) {

	FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
	fillLayout.marginHeight = 5;
	fillLayout.marginWidth = 5;
	parent.setLayout(fillLayout);

	// main container
	container = new Composite(parent, SWT.BORDER);
	container.setLayout(new FillLayout());

	// create container for stack trace data
	Composite stacktraceDataContainer = new Composite(parent, SWT.BORDER);

	FormLayout formLayout = new FormLayout();
	formLayout.marginHeight = 5;
	formLayout.marginWidth = 5;
	formLayout.spacing = 5;
	stacktraceDataContainer.setLayout(formLayout);

	Composite stackLabelContainer = new Composite(stacktraceDataContainer, SWT.NO_SCROLL | SWT.SHADOW_NONE);
	stackLabelContainer.setLayout(new GridLayout());

	FormData stackLabelFormData = new FormData();
	stackLabelFormData.top = new FormAttachment(0);
	stackLabelFormData.left = new FormAttachment(0);
	stackLabelFormData.right = new FormAttachment(100);
	stackLabelFormData.bottom = new FormAttachment(20);
	stackLabelContainer.setLayoutData(stackLabelFormData);

	Composite stackTraceContainer = new Composite(stacktraceDataContainer, SWT.NO_SCROLL | SWT.SHADOW_NONE);
	stackTraceContainer.setLayout(new FillLayout());

	FormData stackTraceFormData = new FormData();
	stackTraceFormData.top = new FormAttachment(stackLabelContainer);
	stackTraceFormData.left = new FormAttachment(0);
	stackTraceFormData.right = new FormAttachment(100);
	stackTraceFormData.bottom = new FormAttachment(100);
	stackTraceContainer.setLayoutData(stackTraceFormData);

	// Create viewer for test tree in main container
	testTreeViewer = new TreeViewer(container);
	testTreeViewer.setContentProvider(new XpectContentProvider());
	testTreeViewer.setLabelProvider(new XpectLabelProvider(this.testsExecutionStatus));
	testTreeViewer.setInput(null);

	// create stack trace label
	stacktraceLabel = new Label(stackLabelContainer, SWT.SHADOW_OUT);
	FontData fontData = stacktraceLabel.getFont().getFontData()[0];
	Display display = Display.getCurrent();
	// may be null if outside the UI thread
	if (display == null)
		display = Display.getDefault();
	Font font = new Font(display, new FontData(fontData.getName(), fontData
			.getHeight(), SWT.BOLD));
	// Make stack trace label bold
	stacktraceLabel.setFont(font);

	stacktraceLabel.setText(NO_TRACE_MSG);

	// create stack trace console
	MessageConsole messageConsole = new MessageConsole("trace", null);
	stacktraceConsole = new TraceConsole(messageConsole);
	stacktraceConsoleViewer = new TextConsoleViewer(stackTraceContainer, messageConsole);

	// context menu
	getSite().setSelectionProvider(testTreeViewer);
	MenuManager contextMenu = new MenuManager();
	contextMenu.setRemoveAllWhenShown(true);
	getSite().registerContextMenu(contextMenu, testTreeViewer);
	Control control = testTreeViewer.getControl();
	Menu menu = contextMenu.createContextMenu(control);
	control.setMenu(menu);
	activateContext();

	createSelectionActions();

}
 
Example 19
Source File: TabbedPropertySheetWidgetFactory.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a group as a part of the form.
 *
 * @param parent
 *            the group parent.
 * @param text
 *            the group title.
 * @return the composite.
 */
public Group createGroup(Composite parent, String text) {
    Group group = new Group(parent, SWT.SHADOW_NONE);
    group.setText(text);
    group.setBackground(getColors().getBackground());
    group.setForeground(getColors().getForeground());
    return group;
}
 
Example 20
Source File: FormWidgetFactory.java    From birt with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Creates a group as a part of the form.
 * 
 * @param parent
 *            the group parent.
 * @param text
 *            the group title.
 * @return the composite.
 */
public Group createGroup( Composite parent, String text )
{
	Group group = new Group( parent, SWT.SHADOW_NONE );
	group.setText( text );
	group.setBackground( getColors( ).getBackground( ) );
	group.setForeground( getColors( ).getForeground( ) );
	return group;
}