package net.kldp.logviewer;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.custom.StyledText;

public class AddOrModifyLogView__ {

	private Shell sShell = null;  //  @jve:decl-index=0:visual-constraint="2,10"
	private Label lblGroup = null;

	private Label lblName = null;

	private Text txtNm = null;

	private Combo cbMethod = null;

	private Label lblMethod = null;

	private Label lblFileNm = null;

	private Text txtFileNm = null;

	private Label lblDelay = null;

	private Text txtDelay = null;

	private Label lblDelayNm = null;
	
	private CLabel cLabel = null;
	private Text txtGroupNm = null;
	private Group grpFont = null;
	private Label lblFont = null;
	private Combo cbFont = null;
	private Combo cbFontSize = null;
	private Group grpFTP = null;
	private Label lblIP = null;
	private Label lblID = null;
	private Label lblPass = null;
	private Text txtIP = null;
	private Text txtPort = null;
	private Text txtId = null;
	private Text txtPass = null;
	private Button chkPasMode = null;
	private Button btnFontCol = null;
	private Button btnBackCol = null;
	private CLabel lbBackCol = null;
	private CLabel lbFontCol = null;
	private StyledText tstStyledTxt = null;
	private Text txtLineMit = null;
	private Label lblLineLimit = null;
	private Group grpAlarm = null;
	private Text txtAlarm = null;
	private Combo cbAlarmType = null;
	private CLabel lbAlarm = null;
	private Button btnAlarmCol = null;
	/**
	 * This method initializes sShell
	 */
	private void createSShell() {
		sShell = new Shell();
		sShell.setText("로그정보");
		sShell.setLayout(null);
		sShell.setSize(new Point(380, 539));
		
		cLabel = new CLabel(sShell, SWT.SHADOW_OUT);
		cLabel.setText("환경설정");  // Generated
		cLabel.setFont(new Font(Display.getDefault(), "굴림체", 11, SWT.BOLD));  // Generated
		cLabel.setBounds(new Rectangle(3, 2, 362, 24));  // Generated	
		
		lblGroup = new Label(sShell, SWT.NONE);
		lblGroup.setText("그룹명: ");  // Generated
		lblGroup.setBounds(new Rectangle(10, 31, 65, 12));  // Generated
		lblName = new Label(sShell, SWT.NONE);
		lblName.setBounds(new Rectangle(10, 56, 65, 12));  // Generated
		lblName.setText("이   름: ");  // Generated
		txtNm = new Text(sShell, SWT.BORDER);
		txtNm.setBounds(new Rectangle(80, 54, 145, 20));
		sShell.setLayout(null);  // Generated
		createCbMethod();
		lblMethod = new Label(sShell, SWT.NONE);
		lblMethod.setBounds(new Rectangle(10, 83, 63, 14));  // Generated
		lblMethod.setText("방   법: ");  // Generated
		lblFileNm = new Label(sShell, SWT.NONE);
		lblFileNm.setBounds(new Rectangle(9, 204, 65, 13));  // Generated
		lblFileNm.setText("파일명: ");  // Generated
		txtFileNm = new Text(sShell, SWT.BORDER);
		txtFileNm.setBounds(new Rectangle(79, 197, 282, 20));  // Generated
		lblDelay = new Label(sShell, SWT.NONE);
		lblDelay.setBounds(new Rectangle(9, 225, 63, 15));  // Generated
		lblDelay.setText("작업주기: ");  // Generated
		txtDelay = new Text(sShell, SWT.BORDER);
		txtDelay.setBounds(new Rectangle(79, 222, 122, 20));  // Generated
		lblDelayNm = new Label(sShell, SWT.NONE);
		lblDelayNm.setBounds(new Rectangle(208, 224, 38, 14));  // Generated
		lblDelayNm.setText("초");  // Generated	
		txtGroupNm = new Text(sShell, SWT.BORDER);
		txtGroupNm.setBounds(new Rectangle(80, 29, 145, 20));  // Generated
		createGrpFont();
		createGrpFTP();
		createGrpAlarm();
	}
	
	/**
	 * This method initializes cbMethod	
	 *
	 */
	private void createCbMethod() {
		cbMethod = new Combo(sShell, SWT.READ_ONLY);
		cbMethod.setEnabled(true);  // Generated
		cbMethod.setBounds(new Rectangle(80, 79, 145, 20));  // Generated
		cbMethod.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
			public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
				int selIndex = cbMethod.getSelectionIndex();
				
				System.out.println("[콤보박스 선택인덱스]" + selIndex); // TODO Auto-generated Event stub modifyText()
				
				if(selIndex == 1) {
			//		MessageDialog.openWarning(getShell(), "확인", "현재는 파일만 됩니다. 조만간 업그레이드 예정입니다.");
				}
				
			}
		});
		
		cbMethod.add("로컬파일", 0);
		cbMethod.add("FTP", 1);
		
		// 현재는 파일을 선택하도록 한다.
		cbMethod.select(0);
	}

	/**
	 * This method initializes grpFont	
	 *
	 */
	private void createGrpFont() {
		grpFont = new Group(sShell, SWT.SHADOW_ETCHED_OUT);
		grpFont.setLayout(null);
		grpFont.setText("기타");
		grpFont.setBounds(new Rectangle(9, 255, 354, 162));
		lblFont = new Label(grpFont, SWT.NONE);
		lblFont.setBounds(new Rectangle(8, 24, 61, 21));
		lblFont.setText("폰  트: ");
		createCbFont();
		createCbFontSize();
		btnFontCol = new Button(grpFont, SWT.UP | SWT.PUSH);
		btnFontCol.setBounds(new Rectangle(219, 24, 67, 22));  // Generated
		btnFontCol.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));  // Generated
		btnFontCol.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));  // Generated		
		btnFontCol.setText("폰트색");  // Generated
		btnFontCol.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
				System.out.println("widgetSelected()"); // TODO Auto-generated Event stub widgetSelected()
			}
		});
		btnBackCol = new Button(grpFont, SWT.PUSH);
		btnBackCol.setBounds(new Rectangle(75, 56, 68, 22));  // Generated
		btnBackCol.setText("배경색");  // Generated
		lbBackCol = new CLabel(grpFont, SWT.NONE);
		lbBackCol.setText("");  // Generated
		lbBackCol.setBackground(new Color(Display.getCurrent(), 109, 233, 216));  // Generated
		lbBackCol.setBounds(new Rectangle(144, 57, 50, 20));  // Generated
		lbFontCol = new CLabel(grpFont, SWT.NONE);
		lbFontCol.setText("CLabel");  // Generated
		lbFontCol.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));  // Generated
		lbFontCol.setBounds(new Rectangle(289, 25, 49, 21));  // Generated
		tstStyledTxt = new StyledText(grpFont, SWT.NONE);
		tstStyledTxt.setBounds(new Rectangle(73, 89, 274, 59));  // Generated
		txtLineMit = new Text(grpFont, SWT.BORDER);
		txtLineMit.setBounds(new Rectangle(276, 58, 74, 20));  // Generated
		lblLineLimit = new Label(grpFont, SWT.NONE);
		lblLineLimit.setBounds(new Rectangle(213, 57, 60, 21));  // Generated
		lblLineLimit.setText("라인한계");  // Generated
		lbFontCol.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));  // Generated
		btnBackCol.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
		//		System.out.println("widgetSelected()"); // TODO Auto-generated Event stub widgetSelected()
			}
		});
	}

	/**
	 * This method initializes cbFont	
	 *
	 */
	private void createCbFont() {
		cbFont = new Combo(grpFont, SWT.READ_ONLY);
		cbFont.setBounds(new Rectangle(72, 24, 71, 20));
		cbFont.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
			public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
				System.out.println("modifyText()"); // TODO Auto-generated Event stub modifyText()
			}
		});
	}

	/**
	 * This method initializes cbFontSize	
	 *
	 */
	private void createCbFontSize() {
		cbFontSize = new Combo(grpFont, SWT.READ_ONLY);
		cbFontSize.setBounds(new Rectangle(146, 24, 70, 20));
	}

	/**
	 * This method initializes grpFTP	
	 *
	 */
	private void createGrpFTP() {
		grpFTP = new Group(sShell, SWT.NONE);
		grpFTP.setLayout(null);
		grpFTP.setBounds(new Rectangle(83, 102, 278, 87));
		grpFTP.setBounds(new Rectangle(83, 105, 278, 87));
		lblIP = new Label(grpFTP, SWT.NONE);
		lblIP.setBounds(new Rectangle(10, 16, 57, 15));
		lblIP.setText("IP/Port: ");
		lblID = new Label(grpFTP, SWT.NONE);
		lblID.setBounds(new Rectangle(8, 39, 56, 18));
		lblID.setText("ID/Pass: ");
		lblPass = new Label(grpFTP, SWT.NONE);
		lblPass.setBounds(new Rectangle(8, 65, 95, 18));
		lblPass.setText("Passve Mode: ");
		txtIP = new Text(grpFTP, SWT.BORDER);
		txtIP.setBounds(new Rectangle(68, 13, 99, 22));
		txtIP.setEnabled(true);
		txtPort = new Text(grpFTP, SWT.BORDER);
		txtPort.setBounds(new Rectangle(170, 13, 36, 21));
		txtPort.setEnabled(false);
		txtId = new Text(grpFTP, SWT.BORDER);
		txtId.setBounds(new Rectangle(68, 38, 100, 21));
		txtId.setEnabled(false);
		txtPass = new Text(grpFTP, SWT.BORDER | SWT.PASSWORD);
		txtPass.setBounds(new Rectangle(170, 38, 97, 21));
		txtPass.setEnabled(false);
		chkPasMode = new Button(grpFTP, SWT.CHECK);
		chkPasMode.setBounds(new Rectangle(108, 65, 22, 21));
		chkPasMode.setEnabled(false);
	}

	/**
	 * This method initializes grpAlarm	
	 *
	 */
	private void createGrpAlarm() {
		grpAlarm = new Group(sShell, SWT.SHADOW_ETCHED_OUT);
		grpAlarm.setLayout(null);  // Generated
		grpAlarm.setText("알람표시");  // Generated
		grpAlarm.setBounds(new Rectangle(10, 424, 355, 71));  // Generated
		txtAlarm = new Text(grpAlarm, SWT.BORDER);
		txtAlarm.setBounds(new Rectangle(72, 17, 266, 20));  // Generated
		createCbAlarmType();
		lbAlarm = new CLabel(grpAlarm, SWT.NONE);
		lbAlarm.setBackground(new Color(Display.getCurrent(), 109, 233, 216));  // Generated
		lbAlarm.setText("");  // Generated
		lbAlarm.setBounds(new Rectangle(126, 44, 52, 20));  // Generated
		btnAlarmCol = new Button(grpAlarm, SWT.PUSH);
		btnAlarmCol.setBounds(new Rectangle(74, 44, 48, 22));  // Generated
		btnAlarmCol.setText("\ubc30\uacbd\uc0c9");  // Generated
	}

	/**
	 * This method initializes cbAlarmType	
	 *
	 */
	private void createCbAlarmType() {
		cbAlarmType = new Combo(grpAlarm, SWT.NONE);
		cbAlarmType.setBounds(new Rectangle(252, 45, 85, 20));  // Generated
	}

}
