Skip to content

Commit

Permalink
Multi-language support (model)
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Jun 9, 2019
1 parent 87a16d9 commit fc4ceee
Showing 1 changed file with 23 additions and 19 deletions.
Expand Up @@ -18,51 +18,55 @@

import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.DBPNamedObjectLocalized;
import org.jkiss.dbeaver.model.app.DBPPlatformLanguage;
import org.jkiss.dbeaver.model.impl.AbstractContextDescriptor;
import org.jkiss.dbeaver.registry.RegistryConstants;

/**
* PlatformLanguageDescriptor
*/
public class PlatformLanguageDescriptor extends AbstractContextDescriptor implements DBPPlatformLanguage
{
public class PlatformLanguageDescriptor extends AbstractContextDescriptor implements DBPPlatformLanguage, DBPNamedObjectLocalized {
public static final String EXTENSION_ID = "org.jkiss.dbeaver.language"; //$NON-NLS-1$

private final String code;
private final String label;
private final String description;
private final IConfigurationElement config;

public PlatformLanguageDescriptor(
IConfigurationElement config)
{
public PlatformLanguageDescriptor(IConfigurationElement config) {
super(config);

this.code = config.getAttribute(RegistryConstants.ATTR_CODE);
this.label = config.getAttribute(RegistryConstants.ATTR_LABEL);
this.description = config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
this.config = config;
}

@NotNull
@Override
public String getCode() {
return code;
return config.getAttribute(RegistryConstants.ATTR_CODE);
}

@NotNull
@Override
public String getLabel()
{
return label;
public String getLabel() {
return config.getAttribute(RegistryConstants.ATTR_LABEL);
}

public String getDescription()
{
return description;
public String getDescription() {
return config.getAttribute(RegistryConstants.ATTR_DESCRIPTION);
}

@Override
public String toString() {
return code;
return getCode();
}

@NotNull
@Override
public String getName() {
return getLabel();
}

@Override
public String getLocalizedName(String locale) {
return config.getAttribute(RegistryConstants.ATTR_LABEL, locale);
}

}

0 comments on commit fc4ceee

Please sign in to comment.