private void createShell() {
		int leftPercent = 20, bottomPercent = 20;
		shell.setText(RepDevMain.NAMESTR);
		if(Config.getHostNameInTitle())
			shell.setText(shell.getText() + " - " + Config.getServer());
		shell.setImage(RepDevMain.smallProgramIcon);
		if(Config.getWindowSize() != null)
			shell.setSize(Config.getWindowSize());

		createMenuDefault();

		shell.setLayout(new FormLayout());

		shell.addShellListener(new ShellAdapter() {

			public void shellClosed(ShellEvent e) {
				boolean close = true;
				Config.setWindowMaximized(shell.getMaximized());
				if(shell.getMaximized()){
					shell.setMaximized(false);
				}
				Config.setWindowSize(shell.getSize());

				for (CTabItem tab : mainfolder.getItems())
					if (!confirmClose(tab))
						close = false;

				e.doit = close;
			}
		});

		// Create the CoolBar
		coolBar = new CoolBar(shell, SWT.NONE);
		FormData cBarData = new FormData();
		cBarData.top = new FormAttachment(0);
		cBarData.left = new FormAttachment(0);
		cBarData.right = new FormAttachment(100);
		coolBar.setLayoutData(cBarData);

		coolItems = new ArrayList<CoolItem>();
		coolBar.addListener(SWT.Resize, new Listener() {
			public void handleEvent(Event event) {
				shell.layout();
			}
		});

		
		createExplorer(left);

		right.setLayout(new FormLayout());

		createEditorBar();
		coolBar.pack();

		createEditorPane(main);
		createBottom(bottom);

		createStatusBar();

		FormData frmLeft = new FormData();
		frmLeft.top = new FormAttachment(coolBar);
		frmLeft.left = new FormAttachment(0);
		frmLeft.right = new FormAttachment(sashVert);
		frmLeft.bottom = new FormAttachment(statusBar);
		left.setLayoutData(frmLeft);

		
		frmSashVert.top = new FormAttachment(coolBar);
//		if(Config.getSashVSize() != 0)
			frmSashVert.left = new FormAttachment(0,Config.getSashVSize());
//		else
//			frmSashVert.left = new FormAttachment(leftPercent);
		frmSashVert.bottom = new FormAttachment(statusBar);
		sashVert.setLayoutData(frmSashVert);

		FormData frmRight = new FormData();
		frmRight.top = new FormAttachment(coolBar);
		frmRight.left = new FormAttachment(sashVert);
		frmRight.right = new FormAttachment(100);
		frmRight.bottom = new FormAttachment(statusBar);
		right.setLayoutData(frmRight);

		FormData frmMain = new FormData();
		frmMain.top = new FormAttachment(coolBar);
		frmMain.left = new FormAttachment(0);
		frmMain.right = new FormAttachment(100);
		frmMain.bottom = new FormAttachment(sashHoriz);
		main.setLayoutData(frmMain);
		
		if(Config.getSashHSize() != 0)
			frmSashHoriz.top = new FormAttachment (100, -Config.getSashHSize());
		else
			frmSashHoriz.top = new FormAttachment(100, -3);
		frmSashHoriz.left = new FormAttachment(0);
		frmSashHoriz.right = new FormAttachment(100);
		sashHoriz.setLayoutData(frmSashHoriz);

		FormData frmBottom = new FormData();
		frmBottom.top = new FormAttachment(sashHoriz);
		frmBottom.left = new FormAttachment(0);
		frmBottom.right = new FormAttachment(100);
		frmBottom.bottom = new FormAttachment(100);
		bottom.setLayoutData(frmBottom);

		left.addControlListener(new ControlAdapter() {
			public void controlResized(ControlEvent e) {
//				if (left.getSize().x < MIN_COMP_SIZE) {
//					frmSashVert.left = new FormAttachment(0, MIN_COMP_SIZE);
//					shell.layout();
//				}
			}
		});

		bottom.addControlListener(new ControlAdapter() {
			public void controlResized(ControlEvent e) {
//				if (bottom.getSize().y < MIN_COMP_SIZE) {
//					if( right.getSize().y - MIN_COMP_SIZE >= 0 ){
//						frmSashHoriz.top = new FormAttachment(right.getSize().y - MIN_COMP_SIZE, right.getSize().y, 0);
//						right.layout();
//					}
//				}
			}
		});

		sashVert.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event e) {
//
//				if (e.x < MIN_COMP_SIZE)
//					e.x = MIN_COMP_SIZE;
//
//				if (shell.getClientArea().width - e.x < MIN_COMP_SIZE)
//					e.x = shell.getClientArea().width - MIN_COMP_SIZE;

				if (e.x != sashVert.getBounds().x) {
					frmSashVert.left = new FormAttachment(0, e.x);
					shell.layout();
				}
				Config.setSashVSize(e.x);
			}
		});

//		sashVert.addListener(SWT.MouseEnter, new Listener() {
//			public void handleEvent(Event e) {
//
//				if (e.x < MIN_COMP_SIZE)
//					e.x = MIN_COMP_SIZE;
//
//				if (shell.getClientArea().width - e.x < MIN_COMP_SIZE)
//					e.x = shell.getClientArea().width - MIN_COMP_SIZE;
//
//				if (e.x != sashVert.getBounds().x) {
//					frmSashVert.left = new FormAttachment(0, e.x);
//					shell.layout();
//				}
//				//Config.setSashVSize(e.x);
//			}
//		});
		
//		sashVert.addListener(SWT.MouseExit, new Listener() {
//			public void handleEvent(Event e) {
//
//				e.x = 0;
//				e.x = shell.getClientArea().width;
//
//				if (e.x != sashVert.getBounds().x) {
//					frmSashVert.left = new FormAttachment(0, e.x);
//					shell.layout();
//				}
//				//Config.setSashVSize(e.x);
//			}
//		});
		
		sashHoriz.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event e) {
//				if (e.y < MIN_COMP_SIZE)
//					e.y = MIN_COMP_SIZE;
//
//				if (right.getSize().y - e.y < MIN_COMP_SIZE)
//					e.y = right.getSize().y - MIN_COMP_SIZE;

				if (e.y != sashHoriz.getBounds().y) {
					frmSashHoriz.top = new FormAttachment(e.y, right.getSize().y, 0);
					right.layout();
				}
				Config.setSashHSize(bottom.getSize().y);
			}
		});

		findReplaceShell = new FindReplaceShell(shell);
		shell.setMinimumSize(3 * MIN_COMP_SIZE, 3 * MIN_COMP_SIZE);
		shell.setMaximized(Config.getWindowMaximized());
	}