Skip to content

Commit

Permalink
Set Capabilities in relevant descriptors of InAndOutDataProviderFactory
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Hufmann <[email protected]>
  • Loading branch information
bhufmann committed Jan 7, 2025
1 parent a619711 commit b86760d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderDescriptor.ProviderType;
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderFactory;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfConfigurationException;
import org.eclipse.tracecompass.tmf.core.model.DataProviderCapabilities;
import org.eclipse.tracecompass.tmf.core.model.DataProviderDescriptor;
import org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataProvider;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
Expand Down Expand Up @@ -72,6 +73,7 @@ public class InAndOutDataProviderFactoryTest {
.setName(EXPECTED_CONFIGURATOR_NAME)
.setDescription(EXPECTED_CONFIGURATOR_DESCRIPTION)
.setProviderType(ProviderType.NONE)
.setCapabilities(new DataProviderCapabilities.Builder().setCanCreate(true).build())
.build();

private static InAndOutDataProviderFactory sfFixture = new InAndOutDataProviderFactory();
Expand Down Expand Up @@ -166,6 +168,7 @@ public void testCreateAndDeleteDataProviderDescriptor() throws TmfConfigurationE
assertEquals(CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION, descriptor.getDescription());
assertEquals(ProviderType.NONE, descriptor.getType());
assertEquals(EXPECTED_FACTORY_ID, descriptor.getParentId());
assertEquals(new DataProviderCapabilities.Builder().setCanDelete(true).build(), descriptor.getCapabilities());
ITmfConfiguration config = descriptor.getConfiguration();
assertNotNull(config);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Ericsson
* Copyright (c) 2024, 2025 Ericsson
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0 which
Expand Down Expand Up @@ -37,6 +37,7 @@
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderDescriptor.ProviderType;
import org.eclipse.tracecompass.tmf.core.dataprovider.IDataProviderFactory;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfConfigurationException;
import org.eclipse.tracecompass.tmf.core.model.DataProviderCapabilities;
import org.eclipse.tracecompass.tmf.core.model.DataProviderDescriptor;
import org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataModel;
import org.eclipse.tracecompass.tmf.core.model.tree.ITmfTreeDataProvider;
Expand Down Expand Up @@ -98,6 +99,7 @@ public class InAndOutDataProviderFactory implements IDataProviderFactory, ITmfDa
.setName(CONFIGURATOR_NAME)
.setDescription(CONFIGURATOR_DESCRIPTION)
.setProviderType(ProviderType.NONE)
.setCapabilities(new DataProviderCapabilities.Builder().setCanCreate(true).build())
.build();

/**
Expand Down Expand Up @@ -264,6 +266,7 @@ private static IDataProviderDescriptor getDescriptorFromConfig(ITmfConfiguration
.setDescription(NLS.bind(CUSTOM_IN_AND_OUT_ANALYSIS_DESCRIPTION, config.getName()))
.setProviderType(ProviderType.NONE)
.setConfiguration(config)
.setCapabilities(new DataProviderCapabilities.Builder().setCanDelete(true).build())
.build();
}
}

0 comments on commit b86760d

Please sign in to comment.