summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/gui/tabs/collection/CollectionView.java
blob: 62a598c66842395d6bd36da9d0012fe3c5024f3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.c2kernel.gui.tabs.collection;

import javax.swing.JPanel;

import com.c2kernel.collection.Collection;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.gui.MainFrame;
import com.c2kernel.utils.Logger;

/**************************************************************************
 *
 * $Revision: 1.1 $
 * $Date: 2004/08/10 07:56:08 $
 *
 * Copyright (C) 2003 CERN - European Organization for Nuclear Research
 * All rights reserved.
 **************************************************************************/


public abstract class CollectionView extends JPanel {

	protected Collection thisColl;
    protected ItemProxy item;

    public CollectionView() {
        super();
    }
    
    public void setItem(ItemProxy entity) {
        this.item = entity;
    }
    
    public abstract void setCollection(Collection coll);      
    
    protected void saveCollection()
    {
        try
        {
            String[] params = new String[1];
            params[0] = com.c2kernel.utils.CastorXMLUtility.marshall(thisColl);
            MainFrame.userAgent.execute(item, "AddC2KObject", params);
        }
        catch (Exception e)
        {
            Logger.error(e);
        }
    }
}