Commiting stuff the IDE did not
This commit is contained in:
parent
73a3de5eb8
commit
ff7138bf9d
52 changed files with 3887 additions and 3887 deletions
|
|
@ -1,88 +1,88 @@
|
|||
package com.ericsson.uecontrol.gui;
|
||||
|
||||
import android.app.ListActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.ericsson.uecontrol.R;
|
||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||
import com.ericsson.uecontrol.core.UeControlExecutor;
|
||||
import com.ericsson.uecontrol.gui.fragments.ConfigureDialog;
|
||||
import com.ericsson.uecontrol.gui.fragments.SelectBehaviourDialog;
|
||||
import com.ericsson.uecontrol.gui.util.BehaviourListAdapter;
|
||||
import com.ericsson.uecontrol.gui.util.Configurator;
|
||||
import com.ericsson.uecontrol.gui.util.DynamicListView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EditActivity extends ListActivity implements AdapterView.OnItemClickListener {
|
||||
private UeControlExecutor executor;
|
||||
private BehaviourListAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_edit);
|
||||
|
||||
final List<UeBehaviour> list;
|
||||
executor = MainActivity.getExecutor();
|
||||
list = executor.getBehaviourList();
|
||||
|
||||
adapter = new BehaviourListAdapter(this, list);
|
||||
adapter.setEditable(true);
|
||||
DynamicListView listView = (DynamicListView) findViewById(android.R.id.list);
|
||||
listView.setAdapter(adapter);
|
||||
listView.setActionListener(adapter);
|
||||
listView.setOnItemClickListener(this);
|
||||
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.edit, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_add) {
|
||||
SelectBehaviourDialog selector = new SelectBehaviourDialog();
|
||||
selector.setSelectionCallback(new SelectBehaviourDialog.BehaviourSelectionCallback() {
|
||||
public void behaviourSelected(String name, Class<UeBehaviour> objClass) {
|
||||
try {
|
||||
UeBehaviour obj = objClass.newInstance();
|
||||
executor.addBehaviour(obj);
|
||||
adapter.generateIds();
|
||||
adapter.notifyDataSetChanged();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
selector.show(getFragmentManager(), "behaviour_selector");
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
UeBehaviour behaviour = executor.getBehaviourList().get(i);
|
||||
Configurator confer = new Configurator(behaviour);
|
||||
|
||||
ConfigureDialog dialog = new ConfigureDialog();
|
||||
dialog.setConfigurator(confer);
|
||||
dialog.show(getFragmentManager(), "behaviour_configurator");
|
||||
}
|
||||
}
|
||||
package com.ericsson.uecontrol.gui;
|
||||
|
||||
import android.app.ListActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.ericsson.uecontrol.R;
|
||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||
import com.ericsson.uecontrol.core.UeControlExecutor;
|
||||
import com.ericsson.uecontrol.gui.fragments.ConfigureDialog;
|
||||
import com.ericsson.uecontrol.gui.fragments.SelectBehaviourDialog;
|
||||
import com.ericsson.uecontrol.gui.util.BehaviourListAdapter;
|
||||
import com.ericsson.uecontrol.gui.util.Configurator;
|
||||
import com.ericsson.uecontrol.gui.util.DynamicListView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EditActivity extends ListActivity implements AdapterView.OnItemClickListener {
|
||||
private UeControlExecutor executor;
|
||||
private BehaviourListAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_edit);
|
||||
|
||||
final List<UeBehaviour> list;
|
||||
executor = MainActivity.getExecutor();
|
||||
list = executor.getBehaviourList();
|
||||
|
||||
adapter = new BehaviourListAdapter(this, list);
|
||||
adapter.setEditable(true);
|
||||
DynamicListView listView = (DynamicListView) findViewById(android.R.id.list);
|
||||
listView.setAdapter(adapter);
|
||||
listView.setActionListener(adapter);
|
||||
listView.setOnItemClickListener(this);
|
||||
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.edit, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_add) {
|
||||
SelectBehaviourDialog selector = new SelectBehaviourDialog();
|
||||
selector.setSelectionCallback(new SelectBehaviourDialog.BehaviourSelectionCallback() {
|
||||
public void behaviourSelected(String name, Class<UeBehaviour> objClass) {
|
||||
try {
|
||||
UeBehaviour obj = objClass.newInstance();
|
||||
executor.addBehaviour(obj);
|
||||
adapter.generateIds();
|
||||
adapter.notifyDataSetChanged();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
selector.show(getFragmentManager(), "behaviour_selector");
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
UeBehaviour behaviour = executor.getBehaviourList().get(i);
|
||||
Configurator confer = new Configurator(behaviour);
|
||||
|
||||
ConfigureDialog dialog = new ConfigureDialog();
|
||||
dialog.setConfigurator(confer);
|
||||
dialog.show(getFragmentManager(), "behaviour_configurator");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue