Skip to main content
summaryrefslogtreecommitdiffstats
blob: 53d6cdd631014c07e6e2725d7093cb29f3a256fe (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*******************************************************************************
 * Copyright (c) 2001, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.wst.ws.internal.explorer.platform.favorites.perspective;

import javax.servlet.ServletContext;
import org.eclipse.wst.ws.internal.datamodel.BasicModel;
import org.eclipse.wst.ws.internal.explorer.platform.constants.ActionInputs;
import org.eclipse.wst.ws.internal.explorer.platform.favorites.actions.SwitchPerspectiveFromFavoritesAction;
import org.eclipse.wst.ws.internal.explorer.platform.favorites.datamodel.FavoritesMainElement;
import org.eclipse.wst.ws.internal.explorer.platform.perspective.Controller;
import org.eclipse.wst.ws.internal.explorer.platform.perspective.NodeManager;
import org.eclipse.wst.ws.internal.explorer.platform.perspective.Perspective;
import org.eclipse.wst.ws.internal.explorer.platform.util.DirUtils;

public class FavoritesPerspective extends Perspective
{
    private BasicModel model_;
    private NodeManager nodeManager_;
    private String perspectiveContentFramesetCols_;
    private String savedPerspectiveContentFramesetCols_;
    private String actionsContainerFramesetRows_;
    private String savedActionsContainerFramesetRows_;

    public FavoritesPerspective(Controller controller)
    {
        super("favorites",controller);
    }

    public final void initPerspective(ServletContext application)
    {
        model_ = new BasicModel("FavoritesModel");
        FavoritesMainElement favoritesMainElement = new FavoritesMainElement(getMessage("FAVORITES_MAIN_NODE"), model_, controller_);
        model_.setRootElement(favoritesMainElement);
        nodeManager_ = new NodeManager(controller_);
        FavoritesMainNode favMainNode = new FavoritesMainNode(favoritesMainElement, nodeManager_);
        nodeManager_.setRootNode(favMainNode);
        
        // Starting frameset sizes.
        if (!DirUtils.isRTL())
          perspectiveContentFramesetCols_ = "30%,*";
        else
          perspectiveContentFramesetCols_ = "*,30%";
        savedPerspectiveContentFramesetCols_ = perspectiveContentFramesetCols_;
        actionsContainerFramesetRows_ = "75%,*";
        savedActionsContainerFramesetRows_ = actionsContainerFramesetRows_;        
    }

    public NodeManager getNodeManager() {
        return nodeManager_;
    }

    public String getPerspectiveContentPage()
    {
        return "favorites/fav_perspective_content.jsp";
    }

    public int getPerspectiveId()
    {
        return ActionInputs.PERSPECTIVE_FAVORITES;
    }

    public String getPanesFile() {
        return "favorites/scripts/favoritesPanes.jsp";
    }
    
    public String getProcessFramesetsForm()
    {
      return "favorites/forms/ProcessFavoritesFramesetsForm.jsp";
    }
    
    public String getFramesetsFile()
    {
      return "favorites/scripts/favoritesframesets.jsp";
    }

    public String getTreeContentVar() {
        return "favNavigatorContent";
    }

    public String getTreeContentPage() {
        return "favorites/fav_navigator_content.jsp";
    }

    public String getPropertiesContainerVar() {
        return "favPropertiesContainer";
    }

    public String getPropertiesContainerPage() {
        return "favorites/fav_properties_container.jsp";
    }

    public String getStatusContentVar() {
        return "favStatusContent";
    }

    public String getStatusContentPage() {
        return "favorites/fav_status_content.jsp";
    }

    public String getPropertiesContentVar() {
        return "favPropertiesContent";
    }

    public String getPropertiesContentPage() {
        return "favorites/fav_properties_content.jsp";
    }

    public final String getPerspectiveContentFramesetCols()
    {
      return perspectiveContentFramesetCols_;
    }
    
    public final void setPerspectiveContentFramesetCols(String cols)
    {
      perspectiveContentFramesetCols_ = cols;
    }
    
    public final String getSavedPerspectiveContentFramesetCols()
    {
      return savedPerspectiveContentFramesetCols_;
    }
    
    public final void setSavedPerspectiveContentFramesetCols(String cols)
    {
      savedPerspectiveContentFramesetCols_ = cols;
    }
    
    public final String getActionsContainerFramesetRows()
    {
      return actionsContainerFramesetRows_;
    }
    
    public final void setActionsContainerFramesetRows(String rows)
    {
      actionsContainerFramesetRows_ = rows;
    }
    
    public final String getSavedActionsContainerFramesetRows()
    {
      return savedActionsContainerFramesetRows_;
    }
    
    public final void setSavedActionsContainerFramesetRows(String rows)
    {
      savedActionsContainerFramesetRows_ = rows;
    }
    
    public final String getSwitchPerspectiveFormActionLink(int targetPerspectiveId,boolean forHistory)
    {
      return SwitchPerspectiveFromFavoritesAction.getFormActionLink(targetPerspectiveId,forHistory);
    }
}

Back to the top