View Javadoc
1   /*
2    * Copyright (C) 2003-2014 eXo Platform SAS.
3    *
4    * This is free software; you can redistribute it and/or modify it
5    * under the terms of the GNU Lesser General Public License as
6    * published by the Free Software Foundation; either version 3 of
7    * the License, or (at your option) any later version.
8    *
9    * This software is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   * Lesser General Public License for more details.
13   *
14   * You should have received a copy of the GNU Lesser General Public
15   * License along with this software; if not, write to the Free
16   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
18   */
19  package org.exoplatform.ui;
20  
21  import org.exoplatform.R;
22  import org.exoplatform.controller.document.DocumentActionAdapter;
23  import org.exoplatform.model.ExoFile;
24  
25  import android.annotation.SuppressLint;
26  import android.app.Dialog;
27  import android.view.Window;
28  import android.widget.ListView;
29  import android.widget.TextView;
30  
31  //File action list
32  public class DocumentActionDialog extends Dialog {
33  
34    private ListView             _listViewFileAction;   // List of
35                                                        // action
36  
37    private TextView             _txtvFileName;         // File's
38                                                        // name
39  
40    public ExoFile               myFile;                // Current
41                                                        // file
42  
43    public DocumentActionAdapter _documentActionAdapter;
44  
45    // Constructor
46    @SuppressLint("Instantiatable")
47    public DocumentActionDialog(DocumentActivity context, ExoFile file, boolean isActBar) {
48  
49      super(context);
50  
51      requestWindowFeature(Window.FEATURE_NO_TITLE);
52      setContentView(R.layout.exofileaction);
53  
54      setCanceledOnTouchOutside(true);
55  
56      myFile = file;
57  
58      _documentActionAdapter = new DocumentActionAdapter(context, this, myFile, isActBar);
59  
60      init();
61  
62      setTileForDialog(myFile.name);
63  
64    }
65  
66    public void setTileForDialog(String title) {
67      _txtvFileName.setText(title);
68    }
69  
70    private void init() {
71  
72      _listViewFileAction = (ListView) findViewById(R.id.ListView0_FileAction);
73  
74      _txtvFileName = (TextView) findViewById(R.id.TextView_Title);
75  
76      setDocumentActionAdapter();
77  
78    }
79  
80    public void setDocumentActionAdapter() {
81      _listViewFileAction.setAdapter(_documentActionAdapter);
82    }
83  
84  }