~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/filesystem/TGBrowserDataImpl.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.gui.tools.browser.filesystem;
 
2
 
 
3
import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserData;
 
4
 
 
5
public class TGBrowserDataImpl implements TGBrowserData{
 
6
        
 
7
        private static final String STRING_SEPARATOR = ";";
 
8
        
 
9
        private String title;
 
10
        private String path;
 
11
        
 
12
        public TGBrowserDataImpl(String title,String path){
 
13
                this.title = title;
 
14
                this.path = path;
 
15
        }
 
16
        
 
17
        public String getTitle(){
 
18
                return this.title;
 
19
        }
 
20
        
 
21
        public String getPath(){
 
22
                return this.path;
 
23
        }
 
24
        
 
25
        public String toString(){
 
26
                return (getTitle() + STRING_SEPARATOR + getPath());
 
27
        }
 
28
        
 
29
        public static TGBrowserData fromString(String string) {
 
30
                String[] data = string.split(STRING_SEPARATOR);
 
31
                if(data.length == 2){
 
32
                        return new TGBrowserDataImpl(data[0],data[1]);
 
33
                }
 
34
                return null;
 
35
        }
 
36
}