<commit_before>package org.pentaho.ui.xul.swt.tags;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.containers.XulToolbar;
import org.pentaho.ui.xul.dom.Element;
import org.pentaho.ui.xul.swt.AbstractSwtXulContainer;

public class SwtToolbar extends AbstractSwtXulContainer implements XulToolbar{

  ToolBar toolbar;
  private ToolbarMode mode;
  
  public SwtToolbar(Element self, XulComponent parent, XulDomContainer domContainer, String tagName) {
    super("toolbar");
    
    String attr = self.getAttributeValue("parenttoouter");
    Object shell = (attr != null && attr.equals("true") && domContainer.getOuterContext() != null) 
      ? domContainer.getOuterContext() 
      : null; 
    if(shell != null && shell instanceof Shell){
      toolbar = new ToolBar((Shell) shell, SWT.HORIZONTAL);
    } else if(shell != null && shell instanceof Composite){<commit_msg>Fixed toolbar mode<commit_after>package org.pentaho.ui.xul.swt.tags;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.containers.XulToolbar;
import org.pentaho.ui.xul.dom.Element;
import org.pentaho.ui.xul.swt.AbstractSwtXulContainer;

public class SwtToolbar extends AbstractSwtXulContainer implements XulToolbar{

  ToolBar toolbar;
  private ToolbarMode mode = ToolbarMode.FULL;
  
  public SwtToolbar(Element self, XulComponent parent, XulDomContainer domContainer, String tagName) {
    super("toolbar");
    
    String attr = self.getAttributeValue("parenttoouter");
    Object shell = (attr != null && attr.equals("true") && domContainer.getOuterContext() != null) 
      ? domContainer.getOuterContext() 
      : null; 
    if(shell != null && shell instanceof Shell){
      toolbar = new ToolBar((Shell) shell, SWT.HORIZONTAL);
    } else if(shell != null && shell instanceof Composite){
{'fraction_non_alphanumeric': 0.11517367458866545, 'fraction_numerical': 0.0, 'mean_word_length': 4.670984455958549, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2560178', 'n_tokens_mistral': 716, 'n_tokens_neox': 706, 'n_words': 142}