12231a594736b6b9627b25b6f998c3484740ebbe
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / tracecontrol / subsystems / TraceSubSystemConfiguration.java
1 /*******************************************************************************
2 * Copyright (c) 2011 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Polytechnique Montréal - Initial API and implementation
11 * Bernd Hufmann - Productification, enhancements and fixes
12 *
13 *******************************************************************************/
14 package org.eclipse.linuxtools.lttng.ui.tracecontrol.subsystems;
15
16 import java.util.List;
17 import java.util.Vector;
18
19 import org.eclipse.linuxtools.lttng.ui.tracecontrol.Messages;
20 import org.eclipse.linuxtools.lttng.ui.tracecontrol.connectorservice.TraceConnectorServiceManager;
21 import org.eclipse.rse.core.filters.ISystemFilter;
22 import org.eclipse.rse.core.filters.ISystemFilterPool;
23 import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
24 import org.eclipse.rse.core.model.IHost;
25 import org.eclipse.rse.core.subsystems.IConnectorService;
26 import org.eclipse.rse.core.subsystems.ISubSystem;
27 import org.eclipse.rse.core.subsystems.SubSystemConfiguration;
28
29 /**
30 * <b><u>TraceSubSystemConfiguration</u></b>
31 * <p>
32 * Implementation of the subsystem configuration to define the trace subsystem configuration.
33 * </p>
34 */
35 public class TraceSubSystemConfiguration extends SubSystemConfiguration {
36
37 // ------------------------------------------------------------------------
38 // Attributes
39 // ------------------------------------------------------------------------
40
41 // ------------------------------------------------------------------------
42 // Constructors
43 // ------------------------------------------------------------------------
44
45 /**
46 * Constructor for TraceSubSystemConfiguration.
47 */
48 public TraceSubSystemConfiguration() {
49 super();
50 }
51
52 // ------------------------------------------------------------------------
53 // Operations
54 // ------------------------------------------------------------------------
55
56 /*
57 * (non-Javadoc)
58 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#createSubSystemInternal(org.eclipse.rse.core.model.IHost)
59 */
60 @Override
61 public ISubSystem createSubSystemInternal(IHost conn) {
62 return new TraceSubSystem(conn, getConnectorService(conn));
63 }
64
65 /*
66 * (non-Javadoc)
67 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#getConnectorService(org.eclipse.rse.core.model.IHost)
68 */
69 @Override
70 public IConnectorService getConnectorService(IHost host) {
71 return TraceConnectorServiceManager.getInstance().getConnectorService(host, ITCFSubSystem.class);
72 }
73
74 /*
75 * (non-Javadoc)
76 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#createDefaultFilterPool(org.eclipse.rse.core.filters.ISystemFilterPoolManager)
77 */
78 @Override
79 protected ISystemFilterPool createDefaultFilterPool(ISystemFilterPoolManager mgr) {
80 ISystemFilterPool defaultPool = null;
81 try {
82 defaultPool = mgr.createSystemFilterPool(getDefaultFilterPoolName(mgr.getName(), getId()), false); // true=>is deletable by user
83 defaultPool.setDeletable(false);
84 defaultPool.setNonRenamable(true);
85 List<String> strings = new Vector<String>();
86 strings.add("*"); //$NON-NLS-1$
87 ISystemFilter filter = mgr.createSystemFilter(defaultPool, Messages.AllProviders, strings);
88 filter.setNonChangable(false);
89 filter.setSingleFilterStringOnly(false);
90 filter.setNonDeletable(true);
91 filter.setNonRenamable(true);
92 } catch (Exception exc) {
93 }
94 return defaultPool;
95 }
96
97 /*
98 * (non-Javadoc)
99 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#getTranslatedFilterTypeProperty(org.eclipse.rse.core.filters.ISystemFilter)
100 *
101 * Intercept of parent method so we can supply our own value shown in the property sheet for the "type" property when a filter is selected within our subsystem.
102 *
103 * Requires this line in LTTngServicesResources.properties: property.type.providerfilter=Lttng_Resource_Provider filter
104 */
105 @Override
106 public String getTranslatedFilterTypeProperty(ISystemFilter selectedFilter) {
107 return Messages.Property_Type_Provider_Filter;
108 }
109
110 public boolean supportsUserId() {
111 return false;
112 }
113
114 /*
115 * (non-Javadoc)
116 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsServerLaunchProperties(org.eclipse.rse.core.model.IHost)
117 */
118 @Override
119 public boolean supportsServerLaunchProperties(IHost host) {
120 return false;
121 }
122
123 /*
124 * (non-Javadoc)
125 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsFilters()
126 */
127 @Override
128 public boolean supportsFilters() {
129 return true;
130 }
131
132 /*
133 * (non-Javadoc)
134 * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#supportsFilterChildren()
135 */
136 @Override
137 public boolean supportsFilterChildren() {
138 return true;
139 }
140 }
This page took 0.033407 seconds and 4 git commands to generate.