package de.fau.cs.mad.fablab.android.view.fragments.inventory;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;

import de.fau.cs.mad.fablab.android.R;
import de.fau.cs.mad.fablab.android.view.fragments.productsearch.ProductClickedEvent;
import de.fau.cs.mad.fablab.android.view.fragments.productsearch.ProductSearchFragment;
import de.fau.cs.mad.fablab.rest.core.User;

public class InventoryProductSearchFragment extends ProductSearchFragment {

    private User mUser;

    public void setUser(User user)
    {
        mUser = user;
    }

    public User getUser()
    {
        return mUser;
    }

    @Override
    public void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setHasOptionsMenu(false);
        mUser = (User) getArguments().getSerializable("USER");
    }

    @Override
    public void onCreateOptionsMenu (Menu menu, MenuInflater inflater) {
        super.onCreateOptionsMenu(menu, inflater);
    }

    @Override
    public void onResume() {
        super.onResume();
        setDisplayOptions(R.id.drawer_item_productsearch, true, false, false);
    }

    @Override
    @SuppressWarnings("unused")
    public void onEvent(ProductClickedEvent event) {
        getFragmentManager().beginTransaction().replace(R.id.fragment_container,
                AddToInventoryDialogFragment.newInstance(event.getProduct(), mUser)).addToBackStack(null)
                .commit();
    }
}

@@ -86,68 +86,8 @@
 dle;
-%0Aimport android.view.Menu;%0Aimport android.view.MenuInflater;
 %0A%0Aim
@@ -692,42 +692,8 @@
 e);%0A
-        setHasOptionsMenu(false);%0A
     
@@ -762,153 +762,8 @@
  %7D%0A%0A
-    @Override%0A    public void onCreateOptionsMenu (Menu menu, MenuInflater inflater) %7B%0A        super.onCreateOptionsMenu(menu, inflater);%0A    %7D%0A%0A
     

add search field in productsearch in inventory