Skip to content

Instantly share code, notes, and snippets.

View esaounkine's full-sized avatar

Ilya Saunkin esaounkine

View GitHub Profile
@esaounkine
esaounkine / styles.xml
Created April 29, 2011 12:45
Intent to start navigation activity - styles
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DialogText">
<item name="android:textColor">#FF231f20</item>
<item name="android:textSize">25sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="DialogText.Title">
<item name="android:textColor">#FF364945</item>
<item name="android:textSize">24sp</item>
@esaounkine
esaounkine / themes.xml
Created April 29, 2011 12:44
Intent to start navigation activity - themes
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TableDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
</style>
</resources>
@esaounkine
esaounkine / gist:948238
Created April 29, 2011 12:42
Intent to start navigation activity - util
static final int TABLE_DIALOG = 0;
ArrayList<TableRow> rows;
String tableDialogTime;
int tableDialogTableHeaderColor;
int tableDialogTableHeaderIcon;
Dialog dialog;
/**
* Pops up a dialog to show a table.
* @param rows
@esaounkine
esaounkine / gist:948236
Created April 29, 2011 12:41
Intent to start navigation activity - payload
final int defaultFlag = PackageManager.MATCH_DEFAULT_ONLY;
Intent[] explicitIntents;
//see an example here http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android
private Intent[] getExplicitIntents() {
if(explicitIntents == null) {
PackageManager currentPM = getPackageManager();
explicitIntents = new Intent[]{
new Intent("android.intent.action.navigon.START_PUBLIC"), //navigon with public intent
currentPM.getLaunchIntentForPackage("com.navigon.navigator"), //navigon without public intent
@esaounkine
esaounkine / gist:948035
Created April 29, 2011 08:14
Accumulative sorting in ADF 10g tables - backing
import oracle.adf.view.faces.event.SortEvent;
import oracle.adf.view.faces.model.SortCriterion;
import oracle.adf.view.faces.component.core.data.CoreTable;
import java.util.List;
import java.util.ArrayList;
public class Customers {
public void onSort(SortEvent se) {
@esaounkine
esaounkine / gist:948033
Created April 29, 2011 08:13
Accumulative sorting in ADF 10g tables - ADF
<table value="#{bindings.CustomerSearch.collectionModel}" var="row"
rows="#{bindings.CustomerSearch.rangeSize}"
first="#{bindings.CustomerSearch.rangeStart}" banding="row"
bandinginterval="1"
emptytext="#{bindings.CustomerSearch.viewable ? 'No rows yet.' : 'Access denied.'}"
sortlistener="#{CustomersBean.onSort}">
<column sortproperty="Customerid" sortable="true"
headertext="#{bindings.CustomerSearch.labels.Customerid}">
<commandlink text="#{row.Customerid}"
onclick="return initiateReplacement(#{row.Customerid});"
@esaounkine
esaounkine / gist:948030
Created April 29, 2011 08:12
“javax.faces.convert.ConverterException: Unsupported Model Type” in ADF 10g for selectManyCheckbox - adf
<af:selectManyCheckbox value="#{ManagedBean.selectedItems}">
<f:selectItems value="#{ManagedBean.initialListItems}"/>
</af:selectManyCheckbox>
@esaounkine
esaounkine / gist:948028
Created April 29, 2011 08:11
“javax.faces.convert.ConverterException: Unsupported Model Type” in ADF 10g for selectManyCheckbox - backing
ArrayList<javax.faces.model.SelectItem> initialListItems;
public ArrayList getInitialListItems() {
if(initialListItems == null) {
initialListItems = new ArrayList();
JUIteratorBinding paramIter =
(JUIteratorBinding)JSFUtils.resolveExpression("#{bindings.ParamView1Iterator}");
for(int i = 0; i < paramIter.getEstimatedRowCount(); i++) {
ParamViewRowImpl paramRow = (ParamViewRowImpl)paramIter.getRowAtRangeIndex(i);
SelectItem si = new SelectItem();
@esaounkine
esaounkine / gist:948025
Created April 29, 2011 08:09
add showPopupBehavior to an ADF Rich Faces table column - backing
public void onDeleteConfirmation(oracle.adf.view.rich.event.DialogEvent de) {
if(de.getOutcome().equals(oracle.adf.view.rich.event.DialogEvent.Outcome.ok)) {
deleteSelectedRow();
FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(FacesContext.getCurrentInstance(), "", "scheduler");
}
}
@esaounkine
esaounkine / gist:948023
Created April 29, 2011 08:08
add showPopupBehavior to an ADF Rich Faces table column - snippet
<table varstatus="rowStat" value="#{SchedulerBean.localCollectionModel}"
fetchsize="25" contentdelivery="immediate"
rows="#{SchedulerBean.localCollectionModel.rowCount}"
emptytext="#{msg.SCHED_EMPTY_TABLE}" rowselection="single" width="100%"
var="row" rowbandinginterval="0" binding="#{SchedulerBean.schedTable}"
id="schedTable">
<column headertext="#{msg.ACTIONS}" sortable="false"
inlinestyle="background-color:#{(not empty row[SchedulerBean.columns[6].label] and row[SchedulerBean.columns[6].label] eq 'RUNNING'? '#00ff00' :'')};"
width="#{set.ACTIONS_COLUMN_WIDTH}">
<panelformlayout rows="1">