Package ivasoft

Source Code of ivasoft.MainWindowUi

package ivasoft;



import ivasoft.mainwindow.musteri.NewMusteriUi;
import ivasoft.mainwindow.teklif.CompaniesUi;
import ivasoft.mainwindow.urun.NewUrunUi;
import ivasoft.mainwindow.urun.RemoveUrunUi;

import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Runo;


@SuppressWarnings("serial")
public class MainWindowUi  implements Button.ClickListener {
 
  private final VerticalLayout branchLayout = new VerticalLayout();
  private final VerticalLayout teklifLayout = new VerticalLayout();
  private final VerticalLayout urunLayout = new VerticalLayout();
  private final VerticalLayout musteriLayout = new VerticalLayout();
  private final Panel menuPanel = new Panel("MENÜLER");
  private static final Panel rightSideLayout = new Panel();
  private final HorizontalSplitPanel hsp = new HorizontalSplitPanel();
  private final Accordion accordion = new Accordion();
  private final Button urunAddButton = new Button("Yeni Ürün Ekle",this);
  private final Button urunRemoveButton = new Button("Ürün Sil",this);
  private final Button urunUpdateButton = new Button("Ürün Güncelle");
  private final ComboBox urunCategoryBox = new ComboBox("Kategori");
  private final ComboBox urunSearchBox = new ComboBox("Arama Kriteri");
  private final TextField urunSearchField = new TextField("Aranacak Veri");
  private final Button urunSearchButton = new Button("Ara");
  private final Button teklifAddButton = new Button("TEKLİF EKLE",this);
  private final Button musteriAddButton = new Button("MÜŞTERİ EKLE",this);
  private final Button musteriSilButton = new Button("MÜŞTERİ SİL");
  private final Button musteriDuzenleButton = new Button("MÜŞTERİ DÜZENLE");
  private final ComboBox musteriGrupComboBox = new ComboBox("Grup Seçiniz");
  private final ComboBox musteriKaydedenComboBox = new ComboBox("Kaydeden");
  private final TextField musteriAranacakTextField = new TextField("Arama");
  private final Button musteriAraButon = new Button("Ara");
  private final Button teklifSilButton = new Button("TEKLİF SİL");
  private final Button teklifDuzenleButton = new Button("TEKLİF DÜZENLE");
  private final ComboBox teklifBizdenIlgiliComboBox = new ComboBox("Bizden İlgili");
  private final ComboBox teklifOnayDurumuComboBox = new ComboBox("Onay Durumu");
  private final TextField teklifAranacakVeriTextField = new TextField("Aranacak Veri");
  private final Button subeEkle = new Button("Şube Ekle");
  private final Button subeSil = new Button("Şube Sil");
  private final Button subeGuncelle = new Button("Şube Güncelle");
  private final VerticalLayout sablonlarVerticalLayout = new VerticalLayout();
  private final Button onyazilar = new Button("Önyazilar");
  private final Button teklifAraButton = new Button("Ara");


  @SuppressWarnings("deprecation")
  public HorizontalSplitPanel accordionSet() {
    hsp.setMargin(false);
    hsp.setSizeFull();
   
    accordion.setSizeFull();
    hsp.setHeight("630px");
    hsp.setWidth("100%");
    hsp.setSplitPosition(221, Sizeable.UNITS_PIXELS);
    hsp.setLocked(true);
    menuPanel.setWidth("220px");
    menuPanel.setHeight("100%");

    menuPanel.getLayout().setSizeFull();
    menuPanel.getLayout().setMargin(false);
    accordion.addTab(tekliflerLayout(), "Teklifler");
    accordion.addTab(urunlerLayout(), "Ürünler");
    accordion.addTab(musterilerLayout(), "Müşteriler");
    accordion.addTab(subelerLayout(), "Şubeler");
    accordion.addTab(sablonlarLayout(), "Şablonlar");
    menuPanel.addComponent(accordion);
    hsp.setStyle(Runo.SPLITPANEL_REDUCED);
    hsp.addComponent(menuPanel);
    hsp.addComponent(rightSideLayout);
    return hsp;
   
  }
 
 
  @SuppressWarnings("deprecation")
  public VerticalLayout tekliflerLayout() {
    teklifLayout.setSpacing(true);
    teklifAraButton.setSizeFull();
    teklifAranacakVeriTextField.setSizeFull();
    teklifSilButton.setSizeFull();
    teklifDuzenleButton.setSizeFull();
    teklifAddButton.setSizeFull();

    teklifLayout.setMargin(true);
    teklifLayout.addComponent(teklifAddButton);
    teklifLayout.addComponent(teklifSilButton);
    teklifLayout.addComponent(teklifDuzenleButton);
    teklifLayout.addComponent(teklifBizdenIlgiliComboBox);
    teklifLayout.addComponent(teklifOnayDurumuComboBox);
    teklifLayout.addComponent(teklifAranacakVeriTextField);
    teklifLayout.addComponent(teklifAraButton);
    teklifAraButton.setStyle(Runo.BUTTON_DEFAULT);
    return teklifLayout;
  }

  public VerticalLayout urunlerLayout() {
    urunAddButton.setSizeFull();
    urunUpdateButton.setSizeFull();
    urunRemoveButton.setSizeFull();
    urunSearchButton.setSizeFull();
    urunSearchField.setSizeFull();
    urunLayout.setMargin(true);
    urunLayout.setSpacing(true);
    urunLayout.addComponent(urunAddButton);
    urunLayout.addComponent(urunRemoveButton);
    urunLayout.addComponent(urunUpdateButton);
    urunLayout.addComponent(urunCategoryBox);
    urunLayout.addComponent(urunSearchBox);
    urunLayout.addComponent(urunSearchField);
    urunLayout.addComponent(urunSearchButton);
    return urunLayout;

  }

  public VerticalLayout musterilerLayout() {
    musteriLayout.setSpacing(true);
    musteriLayout.setMargin(true);
    musteriAddButton.setSizeFull();
    musteriSilButton.setSizeFull();
    musteriDuzenleButton.setSizeFull();
    musteriLayout.addComponent(musteriAddButton);
    musteriLayout.addComponent(musteriSilButton);
    musteriLayout.addComponent(musteriDuzenleButton);
    musteriLayout.addComponent(musteriGrupComboBox);
    musteriLayout.addComponent(musteriKaydedenComboBox);
    musteriLayout.addComponent(musteriAranacakTextField);
    musteriLayout.addComponent(musteriAraButon);
    return musteriLayout;
  }

  public VerticalLayout subelerLayout() {
    subeEkle.setSizeFull();
    subeSil.setSizeFull();
    subeGuncelle.setSizeFull();
    branchLayout.setSpacing(true);
    branchLayout.setMargin(true);
    branchLayout.addComponent(subeEkle);
    branchLayout.addComponent(subeSil);
    branchLayout.addComponent(subeGuncelle);
    return branchLayout;
  }

  public VerticalLayout sablonlarLayout() {
    onyazilar.setSizeFull();
    sablonlarVerticalLayout.setSpacing(true);
    sablonlarVerticalLayout.setMargin(true);
    sablonlarVerticalLayout.addComponent(onyazilar);
    return sablonlarVerticalLayout;
  }
 
  @SuppressWarnings("deprecation")
  public Panel yanEkranAyarla(Component comp, String baslik) {
    rightSideLayout.setCaption(baslik);
    rightSideLayout.removeAllComponents();
    rightSideLayout.addComponent(comp);
    rightSideLayout.setStyle(Runo.PANEL_LIGHT);
    return rightSideLayout;
  }
 
 
  public void replacePanel(Component old,Component neww) {
    rightSideLayout.replaceComponent(old, neww);
  }


  public void buttonClick(ClickEvent event) {
    // teklif Butonlari
    if (event.getSource().equals(teklifAddButton)) {
      yanEkranAyarla(new CompaniesUi(), "Firma Seçiniz");
      }
   
    // Ürün Butonları
    if (event.getSource().equals(urunAddButton)) {
      yanEkranAyarla(new NewUrunUi(), "Ürün Ekle");
    }
    if(event.getSource().equals(urunRemoveButton)){
      System.out.println("delete");
      yanEkranAyarla(new RemoveUrunUi(), "Ürün Sil");
    }
    if(event.getSource().equals(urunUpdateButton)){
      yanEkranAyarla(new RemoveUrunUi(), "Ürün Güncelle");
    }
   
    // Müşteri Butonları
    if (event.getSource().equals(musteriAddButton)) {
      yanEkranAyarla(new NewMusteriUi(), "Ürün Ekle");
    }
   
  }
 
}
TOP

Related Classes of ivasoft.MainWindowUi

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.