本文整理匯總了Golang中github.com/axel-freesp/sge/models.FilesTreeStore.GetCurrentId方法的典型用法代碼示例。如果您正苦於以下問題:Golang FilesTreeStore.GetCurrentId方法的具體用法?Golang FilesTreeStore.GetCurrentId怎麽用?Golang FilesTreeStore.GetCurrentId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/axel-freesp/sge/models.FilesTreeStore
的用法示例。
在下文中一共展示了FilesTreeStore.GetCurrentId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getToplevelId
func getToplevelId(fts *models.FilesTreeStore) string {
p := fts.GetCurrentId()
if p == "" {
log.Fatal("fileSave error: fts.GetCurrentId() failed")
}
spl := strings.Split(p, ":")
return spl[0] // TODO: move to function in fts...
}
示例2: fileClose
func fileClose(menu *GoAppMenu, fts *models.FilesTreeStore, ftv *views.FilesTreeView, jl IJobList) {
path := fts.GetCurrentId()
if strings.Contains(path, ":") {
path = strings.Split(path, ":")[0]
}
obj, err := fts.GetObjectById(path)
if err != nil {
return
}
global.FileMgr(obj).Remove(obj.(fd.Filenamer).Filename())
jl.Reset()
MenuEditPost(menu, fts, jl)
}
示例3: editCopy
func editCopy(fts *models.FilesTreeStore, clp *gtk.Clipboard) {
var buf []byte
obj, err := fts.GetObjectById(fts.GetCurrentId())
if err != nil {
log.Printf("editCopy error: %s\n", err)
return
}
buf, err = obj.(gr.XmlCreator).CreateXml()
if err != nil {
log.Printf("editCopy error: %s\n", err)
return
}
clp.SetText(string(buf))
}
示例4: editDelete
func editDelete(menu *GoAppMenu, fts *models.FilesTreeStore, jl IJobList, ftv *views.FilesTreeView) {
defer MenuEditPost(menu, fts, jl)
job := DeleteObjectJobNew(fts.GetCurrentId())
state, ok := jl.Apply(EditorJobNew(JobDeleteObject, job))
if ok {
global.win.graphViews.Sync()
path, err := gtk.TreePathNewFromString(state.(string))
if err != nil {
log.Println("editNew error: TreePathNewFromString failed:", err)
return
}
ftv.TreeView().ExpandToPath(path)
ftv.TreeView().SetCursor(path, ftv.TreeView().GetExpanderColumn(), false)
}
}
示例5: ParseText
func ParseText(text string, fts *models.FilesTreeStore) (job *EditorJob, err error) {
var parent tr.TreeElementIf
context := fts.GetCurrentId()
if len(context) == 0 {
err = fmt.Errorf("NewElementJob.ParseText TODO: Toplevel elements not implemented")
return
}
parent, err = fts.GetObjectById(context)
if err != nil {
return
}
var ok bool
var j *PasteJob
switch parent.(type) {
case bh.SignalGraphIf:
j, ok = parseNode(text, context, parent.(bh.SignalGraphIf).ItsType())
if ok {
job = EditorJobNew(JobPaste, j)
//log.Printf("NewElementJob.ParseText: successfully parsed SignalGraphIf\n")
return
}
case bh.SignalGraphTypeIf:
j, ok = parseNode(text, context, parent.(bh.SignalGraphTypeIf))
if ok {
job = EditorJobNew(JobPaste, j)
//log.Printf("NewElementJob.ParseText: successfully parsed SignalGraphTypeIf\n")
return
}
case bh.NodeIf:
j, ok = parseNode(text, getParentId(context), parent.(bh.NodeIf).Context())
if ok {
job = EditorJobNew(JobPaste, j)
//log.Printf("NewElementJob.ParseText: successfully parsed NodeIf\n")
return
}
case bh.NodeTypeIf:
j, ok = parseNodeType(text, getParentId(context))
if ok {
job = EditorJobNew(JobPaste, j)
//log.Printf("NewElementJob.ParseText: successfully parsed NodeTypeIf\n")
return
}
case bh.PortIf:
case bh.PortTypeIf:
case bh.ConnectionIf:
case bh.SignalTypeIf:
j, ok = parseSignalType(text, getParentId(context))
if ok {
job = EditorJobNew(JobPaste, j)
//log.Printf("NewElementJob.ParseText: successfully parsed SignalTypeIf\n")
return
}
case bh.LibraryIf:
j, ok = parseNodeType(text, context)
if ok {
job = EditorJobNew(JobPaste, j)
log.Printf("NewElementJob.ParseText: successfully parsed NodeTypeIf\n")
return
}
j, ok = parseSignalType(text, context)
if ok {
job = EditorJobNew(JobPaste, j)
log.Printf("NewElementJob.ParseText: successfully parsed SignalTypeIf\n")
return
}
case bh.ImplementationIf:
default:
err = fmt.Errorf("NewElementJob.ParseText error: can't insert to context %T", parent)
return
}
err = fmt.Errorf("NewElementJob.ParseText error: function not implemented")
return
}