code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 3 942 | language stringclasses 30 values | license stringclasses 15 values | size int32 3 1.05M | line_mean float64 0.5 100 | line_max int64 1 1k | alpha_frac float64 0.25 1 | autogenerated bool 1 class |
|---|---|---|---|---|---|---|---|---|---|
* {margin:0;padding:0;}
html {height:100%;overflow-y:scroll;font-family:Verdana,Georgia,Serif;}
body {height:100%;font-size:12px;line-height:22px;
display:flex;flex-direction: column;
color:#1b1e1d;background-color:#fbfbfb;}
.container {margin: 0 auto;flex: 1 0 auto;}
.wrap {max-width:800px;margin: 0 auto;padding:0 40px}
.rftd {display: flex;align-items: center;justify-content: center}
.footer {margin: 0 auto;flex-shrink: 0;}
#mainmenu{padding:48px 0}
h1, h2, h3 {font-family:'Vollkorn',Verdana,Georgia,serif;font-weight:normal;}
h1 {font-size:48px;line-height:46px;padding: 0 32px 0 0;color:#e10009;}
h2 {font-size:28px;line-height:26px;color:#e10009;}
h3 {font-size:16px;line-height:22px;}
h1, h1 a, h2, h2 a {font-weight:normal;letter-spacing:-0.04em}
span {padding:0 3em}
hr {clear:both;border:none}
a{outline:none;text-decoration:underline;color:#33342f}
a img{outline:none}
a:hover{color:#1b1e1d;text-decoration:none}
a:visited{text-decoration:none}
img {-webkit-user-select:none;-moz-user-select: none;user-select: none;}
img.fleft{float:left;margin:9px 32px 0 0}
img.fright{float:right;margin:9px 0 0 64px}
.chapter {padding: 3em 0}
.logo {float:left;padding-right: 6em}
.bigspacer{height:66px}
p {padding: 1em 0 0}
table {border: 1px solid #777;border-collapse: collapse;clear:both;float:left;margin:1rem 0;width:98%;}
table td {-moz-hyphens: auto;word-break: break-all;word-wrap: break-word;border: 1px solid #d7d7d7;padding:1rem;vertical-align: baseline;}
::selection{background:#33342f;color:#fbfbfb}
::-moz-selection{background:#33342f;color:#fbfbfb}
::-webkit-selection{background:#33342f;color:#fbfbfb}
| skrr/skrr.github.io | css/skio.css | CSS | cc0-1.0 | 1,631 | 37.833333 | 138 | 0.751073 | false |
/*!CK:906623253!*//*1432615303,*/
._9jo a.navSubmenu,._9jo li.navSubmenu{color:#141823;display:block;max-width:200px;padding:0 22px;text-decoration:none}._9jo .uiLinkButton input{color:#141823;display:block;line-height:22px;padding:0 22px;text-decoration:none}._9jo ._54ne .uiLinkButton input,._9jo ._54ne a.navSubmenu,._9jo li.navSubmenu._54ne a,._9jo li._54ne{background-color:#42599e;color:#fff;text-decoration:none}._9jo .uiSideNavCount{margin-top:3px}._9jo li.navSubmenu a{color:#141823;display:block;text-decoration:none}#logoutMenu ._khf{right:-6px}
#profile_minifeed .reportHide{display:none}
#bootloader_1KeRQ { height: 42px; }
.bootloader_1KeRQ { display:block !important; } | ttm/anthropologicalExperiments | unicamp/Renato Fabbri - lá-vamos nós. Cada dia um passo_files/GTX5fb-eq6w.css | CSS | cc0-1.0 | 686 | 97.142857 | 522 | 0.765306 | false |
#### 更新依赖
在执行build、compile等任务时会解析项目配置的依赖并按照配置的仓库去搜寻下载这些依赖。默认情况下,Gradle会依照Gradle缓存->你配置的仓库的顺序依次搜寻这些依赖,并且一旦找到就会停止搜索。如果想要忽略本地缓存每次都进行远程检索可以通过在执行命令时添加`--refresh-dependencies`参数来强制刷新依赖。
```bash
gradle build --refresh-dependencies
```
当远程仓库上传了相同版本依赖时,有时需要为缓存指定一个时效去检查远程仓库的依赖笨版本,Gradle提供了`cacheChangingModulesFor(int, java.util.concurrent.TimeUnit)` ,`cacheDynamicVersionsFor(int, java.util.concurrent.TimeUnit) `两个方法来设置缓存的时效
```groovy
configurations.all {
//每隔24小时检查远程依赖是否存在更新
resolutionStrategy.cacheChangingModulesFor 24, 'hours'
//每隔10分钟..
//resolutionStrategy.cacheChangingModulesFor 10, 'minutes'
// 采用动态版本声明的依赖缓存10分钟
resolutionStrategy.cacheDynamicVersionsFor 10*60, 'seconds'
}
dependencies {
// 添加changing: true
compile group: "group", name: "module", version: "1.1-SNAPSHOT", changing: true
//简写方式
//compile('group:module:1.1-SNAPSHOT') { changing = true }
}
```
#### 缓存管理
##### 缓存位置管理
Gradle在按照配置的仓库去搜寻下载依赖时,下载的依赖默认会缓存到USER_HOME/.gradle/caches目录下,当然也可以手工修改这个位置。
具体可以参考如下三种方式:
- 通过添加系统变量 GRADLE_USER_HOME
- 设置虚拟机参数 org.gradle.user.home 属性
- 通过命令行-g或者 --gradle-user-home 参数设置
##### 离线模式(总是采用缓存内容)
Gradle提供了一种离线模式,可以让你构建时总是采用缓存的内容而无需去联网检查,如果你并未采用动态版本特性且可以确保项目中依赖的版本都已经缓存到了本地,这无疑是提高构建速度的一个好选择。开启离线模式只需要在执行命令时候添加`--offline`参数即可。当然,采用这种模式的也是有代价的,如果缓存中搜寻不到所需依赖会导致构建失败。
```bash
gradle build --offline
``` | pkaq/GradleTraining | docs/book/ch5/4.依赖的更新与缓存.md | Markdown | cc0-1.0 | 2,331 | 34.473684 | 191 | 0.781737 | false |
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>-wei</title>
<link type="text/css" rel="stylesheet" href="../../style.css">
<h1 lang="art-Latn-x-osv-0010">
-wei
</h1>
<dl>
<dt>Etymology:
<dd>From VIV <i lang="art-Latn-x-osv-0009">*-auei</i> <small>«do»</small>.
</dl>
<h2>affix</h2>
<aside>positive: <i lang="art-Latn-x-osv-0010">-wai</i></aside>
<p> perfective aspect
| literallybenjam/langdev | data/languages/jsv/osv/0010/block001/-wei.html | HTML | cc0-1.0 | 398 | 25.4 | 78 | 0.616162 | false |
// Global Vars to set
var musicas = new Array(11);
musicas[0] = 0; // Wheel A
musicas[1] = 0; // Whell B
musicas[2] = "0;"; // A1
musicas[3] = "0;"; // A2
musicas[4] = "0;"; // A3
musicas[5] = "0;"; // A4
musicas[6] = "0;"; // B1
musicas[7] = "0;"; // B2
musicas[8] = "0;"; // B3
musicas[9] = "0;"; // B4
musicas[10] = 0; // Sings
function ativa_facebook(){
alert('Aguarde...');
FB.api('/me', function(response) {
// console.log(response);
// NORMAL ACTION
$.post('getUser.php', { facebookId: response.id}, function(data){
if(data.success){
//INSERE APENAS BATIDA
$.post('salva_som.php?opc=1', {
m1: musicas[0],
m2: musicas[1],
m3: musicas[2]+musicas[3]+musicas[4]+musicas[5]+musicas[6]+musicas[7]+musicas[8]+musicas[9],
m4: musicas[10],
usuario: data.usuario
}, function(data){
if(data.success){
var image = Math.floor((Math.random()*3)+1);
FB.api('/me/feed', 'post', { message: 'Sinta o sabor da minha batida no FLAVOR DJ: o gerador de som exclusivo do BH DANCE FESTIVAL. BH Dance Festival. A CIDADE NA PISTA.', link: 'https://apps.facebook.com/flavordj/?minhaBatida='+data.batida, picture: 'https://lit-castle-9930.herokuapp.com/img/share/flavor'+image+'.jpg' }, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Sua batida foi compartilhada com sucesso!');
}
});
}
}, 'json');
}else{
//INSERE BATIDA E USUARIO
$.post('salva_som.php?opc=2', {
m1: musicas[0],
m2: musicas[1],
m3: musicas[2]+musicas[3]+musicas[4]+musicas[5]+musicas[6]+musicas[7]+musicas[8]+musicas[9],
m4: musicas[10],
facebookId: response.id,
nome: response.name,
email: response.email,
sexo: response.gender,
cidade: ''
}, function(data){
if(data.success){
var image = Math.floor((Math.random()*3)+1);
FB.api('/me/feed', 'post', { message: 'Sinta o sabor da minha batida no FLAVOR DJ: o gerador de som exclusivo do BH DANCE FESTIVAL. BH Dance Festival. A CIDADE NA PISTA.', link: 'https://apps.facebook.com/flavordj/?minhaBatida='+data.batida, picture: 'https://lit-castle-9930.herokuapp.com/img/share/flavor'+image+'.jpg' }, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Sua batida foi compartilhada com sucesso!');
}
});
}
}, 'json');
}
}, 'json');
});
}
function computa_voto(batida){
FB.api('/me', function(response) {
//console.log(response);
// NORMAL ACTION
$.post('getVoto.php', { facebookId: response.id}, function(data){
if(data.success){
alert('Você já votou em uma batida, obrigado por participar!');
}else{
//INSERE NO BD
$.post('computa_voto.php', {
facebookId: response.id,
batida: batida
}, function(data){
if(data.success){
}
}, 'json');
}
}, 'json');
});
}
function login() {
alert('Você ainda não tem o aplicativo do Flavor DJ. Instale-o primeiro para compartilhar sua batida.');
FB.login(function(response) {
if (response.authResponse) {
ativa_facebook();
} else {
}
}, {scope: 'email, publish_stream'});
}
function desativaetp1(){
$('.audio1').jPlayer("stop");
$('.audio2').jPlayer("stop");
$('.audio3').jPlayer("stop");
$('.audio4').jPlayer("stop");
musicas[0] = "0;";
$('.etapa1, .guide .etapa1 div, .etapa1 li').removeClass('ativo');
$('.etapa1').css('z-index', 2);
}
function desativaetp2(){
$('.audio5').jPlayer("stop");
$('.audio6').jPlayer("stop");
$('.audio7').jPlayer("stop");
$('.audio8').jPlayer("stop");
musicas[1] = "0;";
$('.etapa2, .guide .etapa2 div, .etapa2 li').removeClass('ativo');
$('.etapa2').css('z-index', 2);
}
function desativaetpr(idPlayer, cod){
musicas[cod] = "0;";
$('.audio'+idPlayer).jPlayer("stop");
$('.etapa3').css('z-index', 2);
}
function desativaetp5(){
$('.audio17').jPlayer("stop");
$('.audio18').jPlayer("stop");
$('.audio19').jPlayer("stop");
$('.audio20').jPlayer("stop");
musicas[10] = "0;";
$('.etapa5, .guide .etapa5 div, .etapa5 li').removeClass('ativo');
$('.etapa5').css('z-index', 2);
}
function ativa_anima(){
$('.whel1 div.a').delay(300).animate({ height: '0px' }, 1000);
$('.whel1 div.b').delay(300).animate({ height: '0px' }, 1000, function(){
$('.whel2 div.a').delay(300).animate({ width: '0px' }, 1000);
$('.whel2 div.b').delay(300).animate({ width: '0px' }, 1000);
});
}
$(document).ready(function(){
//login_start();
$('.etapa1').click(function(){
if($(this).hasClass('ativo')){
desativaetp1();
}else{
desativaetp1();
$(this).addClass('ativo');
$(this).css('z-index', 1);
var audioPlayer = $(this).attr('href');
musicas[0] = audioPlayer;
$('.guide .etapa1 div.p'+audioPlayer).addClass('ativo');
$('.visor .etapa1 li.p'+audioPlayer).addClass('ativo');
$(".audio"+audioPlayer).jPlayer("play", 0);
}
return false;
})
$('.etapa2').click(function(){
if($(this).hasClass('ativo')){
desativaetp2();
}else{
desativaetp2();
$(this).addClass('ativo');
$(this).css('z-index', 1);
var audioPlayer = $(this).attr('href');
musicas[1] = audioPlayer;
$('.guide .etapa2 div.p'+audioPlayer).addClass('ativo');
$('.visor .etapa2 li.p'+audioPlayer).addClass('ativo');
$(".audio"+audioPlayer).jPlayer("play", 0);
}
return false;
})
$('.etapa3').click(function(){
var audioPlayer = $(this).attr('href');
var codigo = $(this).data('codigo');
if($(this).hasClass('ativo')){
desativaetpr(audioPlayer,codigo);
$('.guide .etapa3 div.p'+audioPlayer).removeClass('ativo');
$('.visor .etapa3 li.p'+audioPlayer).removeClass('ativo');
$(this).removeClass('ativo');
}else{
$(this).addClass('ativo');
$('.guide .etapa3 div.p'+audioPlayer).addClass('ativo');
$('.visor .etapa3 li.p'+audioPlayer).addClass('ativo');
$(this).css('z-index', 1);
musicas[codigo] = audioPlayer+";";
$(".audio"+audioPlayer).jPlayer("play", 0);
}
return false;
})
$('.etapa4').click(function(){
var audioPlayer = $(this).attr('href');
var cod = $(this).data('codigo');
if($(this).hasClass('ativo')){
desativaetpr(audioPlayer, cod);
$('.guide .etapa4 div.p'+audioPlayer).removeClass('ativo');
$('.visor .etapa4 li.p'+audioPlayer).removeClass('ativo');
$(this).removeClass('ativo');
}else{
$(this).addClass('ativo');
$('.guide .etapa4 div.p'+audioPlayer).addClass('ativo');
$('.visor .etapa4 li.p'+audioPlayer).addClass('ativo');
musicas[cod] = audioPlayer+";";
$(".audio"+audioPlayer).jPlayer("play", 0);
}
return false;
})
$('.etapa5').click(function(){
if($(this).hasClass('ativo')){
desativaetp5();
}else{
desativaetp5();
$(this).addClass('ativo');
var audioPlayer = $(this).attr('href');
musicas[10] = audioPlayer;
$('.guide .etapa5 div.p'+audioPlayer).addClass('ativo');
$('.visor .etapa5 li.p'+audioPlayer).addClass('ativo');
$(".audio"+audioPlayer).jPlayer("play", 0);
}
return false;
})
$(".audio1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct1/1.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct1/1.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio2").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct1/2.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct1/2.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio3").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct1/3.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct1/3.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio4").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct1/4.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct1/4.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio5").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct2/1.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct2/1.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio6").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct2/2.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct2/2.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio7").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct2/3.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct2/3.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio8").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct2/4.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct2/4.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio9").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct3/1.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct3/1.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio10").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct3/2.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct3/2.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio11").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct3/3.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct3/3.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio12").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct3/4.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct3/4.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio13").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct4/1.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct4/1.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio14").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct4/2.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct4/2.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio15").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct4/3.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct4/3.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio16").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct4/4.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct4/4.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio17").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct5/1.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct5/1.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio18").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct5/2.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct5/2.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio19").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct5/3.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct5/3.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$(".audio20").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", { oga: "https://lit-castle-9930.herokuapp.com/sounds/pct5/4.ogg", mp3: "https://lit-castle-9930.herokuapp.com/sounds/pct5/4.mp3" }
)}, swfPath: "js", supplied: "oga, mp3", wmode: "window", loop: true, preload: 'auto'
});
$('body').queryLoader2( { onLoadComplete: ativa_anima() } );
function login_start() {
//alert('Você ainda não tem o aplicativo do Flavor DJ. Instale-o primeiro para compartilhar sua batida.');
FB.login(function(response) {
if (response.authResponse) {
// ativa_facebook();
} else {
}
}, {scope: 'email, publish_stream'});
}
// Share
var cont = 0
var i = 0;
$('a.share').click(function(){
cont = 0;
for(i = 0; i<11; i++){
if((musicas[i] == "0;") || (musicas[i] == 0)){
cont++;
}
}
if(cont == 11){
alert('Você precisa selecionar pelo menos um ingrediente para sua batida.');
}else{
FB.getLoginStatus(function(response) {
// console.log(response);
if (response.status === 'connected') {
// NORMAL ACTION
ativa_facebook();
} else if (response.status === 'not_authorized') {
login();
window.location.reload();
} else {
login();
window.location.reload();
}
});
}
return false;
});
$('.votarBatida').click(function(){
var batida = $(this).attr('href');
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// NORMAL ACTION
computa_voto(batida);
} else if (response.status === 'not_authorized') {
FB.login(function(response) {
if (response.authResponse) {
// NORMAL ACTION
computa_voto(batida);
} else {
// console.log('Sua batida não foi compartilhada.');
}
}, {scope: 'email, publish_stream'});
} else {
FB.login(function(response) {
if (response.authResponse) {
// NORMAL ACTION
computa_voto(batida);
} else {
//console.log('Sua batida não foi compartilhada.');
}
}, {scope: 'email, publish_stream'});
}
});
});
});
| mateuslopesbh/flavordj | js/funcoes.js | JavaScript | cc0-1.0 | 16,201 | 26.305228 | 350 | 0.567688 | false |
# 香肠和腊肠
## 在线分析
[在线计算](https://jsfiddle.net/quanbinn/f6y5jb8p/)
--------------------
### 广东白油肠


注明:
- 这是2008年左右在美国超市里销售的一款xxxxxxx品牌的照片,现在的这种品牌的营养含量大都会这种不相同,一切以销售时产品的营养标签为准。
### 分析结果
这种食品的能量: 480卡路里, 这种食品的总脂肪: 38克, 这种食品的饱和脂肪: 14克, 这种食品的胆固醇: 95毫克, 这种食品的钠: 1590毫克, 这种食品的钙: 0毫克。
占卡路里每天需求总量的:24%, 占总脂肪每天需求总量的:58%, 占饱和脂肪每天需求总量的:56%, 占饱和脂肪每天需求总量的:56%, 占胆固醇每天需求总量的:32%, 占钠每天需求总量的:66%, 占钙每天需求总量的:0%。
总脂肪占比/卡路里占比:2.4, 饱和脂肪占比/卡路里占比:2.3, 胆固醇占比/卡路里占比:1.3, 钠占比/卡路里占比:2.8, 钙占比/卡路里占比:0.0。
- 从总脂肪含量来看,这种食品含有**超高脂肪**。
- 从饱和脂肪含量来看,这种食品含有**超高饱和脂肪**。
- 从胆固醇含量来看,这种食品含有**含量适中的胆固醇**。
- 从钠含量来看,这种食品含有**高钠**。
- 从钙含量来看,这种食品含有**零钙**。
### 与预防癌症的饮食建议的关联
### 与预防高血压的饮食建议的关联
### 与预防功能性消化不良的饮食建议的关联
### 与控制体重的饮食建议的关联
### 你应该怎么做
---------------------
### 湖南腊肉


### 分析结果
这种食品的能量: 340卡路里, 这种食品的总脂肪: 25克, 这种食品的饱和脂肪: 8克, 这种食品的胆固醇: 95毫克, 这种食品的钠: 2020毫克。
占卡路里每天需求总量的:17%, 占总脂肪每天需求总量的:38%, 占饱和脂肪每天需求总量的:32%, 占饱和脂肪每天需求总量的:32%, 占胆固醇每天需求总量的:32%, 占钠每天需求总量的:84%。
总脂肪占比/卡路里占比:2.2, 饱和脂肪占比/卡路里占比:1.9, 胆固醇占比/卡路里占比:1.9, 钠占比/卡路里占比:4.9。
- 从总脂肪含量来看,这种食品含有**超高脂肪**。
- 从饱和脂肪含量来看,这种食品含有**高饱和脂肪**。
- 从胆固醇含量来看,这种食品含有**高胆固醇**。
- 从钠含量来看,这种食品含有**超高钠**。
### 与预防癌症的饮食建议的关联
### 与预防高血压的饮食建议的关联
### 与预防功能性消化不良的饮食建议的关联
### 与控制体重的饮食建议的关联
### 你应该怎么做
---------------------
### Jumbo_Beef_Franks


### 分析结果
这种食品的能量: 330卡路里, 这种食品的总脂肪: 30.5克, 这种食品的饱和脂肪: 14克, 这种食品的胆固醇: 60毫克, 这种食品的钠: 910毫克, 这种食品的钙: 20毫克。
占卡路里每天需求总量的:17%, 占总脂肪每天需求总量的:47%, 占饱和脂肪每天需求总量的:56%, 占饱和脂肪每天需求总量的:56%, 占胆固醇每天需求总量的:20%, 占钠每天需求总量的:38%, 占钙每天需求总量的:2%。
总脂肪占比/卡路里占比:2.8, 饱和脂肪占比/卡路里占比:3.3, 胆固醇占比/卡路里占比:1.2, 钠占比/卡路里占比:2.2, 钙占比/卡路里占比:0.1。
- 从总脂肪含量来看,这种食品含有**超高脂肪**。
- 从饱和脂肪含量来看,这种食品含有**超高饱和脂肪**。
- 从胆固醇含量来看,这种食品含有**含量适中的胆固醇**。
- 从钠含量来看,这种食品含有**高钠**。
- 从钙含量来看,这种食品含有**低钙**。
### 与预防癌症的饮食建议的关联
### 与预防高血压的饮食建议的关联
### 与预防功能性消化不良的饮食建议的关联
### 与控制体重的饮食建议的关联
### 你应该怎么做
---------------------
### kosher_Beef_Salami


### 分析结果
这种食品的能量: 160卡路里, 这种食品的总脂肪: 15克, 这种食品的饱和脂肪: 6克, 这种食品的胆固醇: 25毫克, 这种食品的钠: 450毫克, 这种食品的钙: 20毫克。
占卡路里每天需求总量的:8%, 占总脂肪每天需求总量的:23%, 占饱和脂肪每天需求总量的:24%, 占饱和脂肪每天需求总量的:24%, 占胆固醇每天需求总量的:8%, 占钠每天需求总量的:19%, 占钙每天需求总量的:2%。
总脂肪占比/卡路里占比:2.9, 饱和脂肪占比/卡路里占比:3.0, 胆固醇占比/卡路里占比:1.0, 钠占比/卡路里占比:2.4, 钙占比/卡路里占比:0.3。
- 从总脂肪含量来看,这种食品含有**超高脂肪**。
- 从饱和脂肪含量来看,这种食品含有**超高饱和脂肪**。
- 从胆固醇含量来看,这种食品含有**含量适中的胆固醇**。
- 从钠含量来看,这种食品含有**高钠**。
- 从钙含量来看,这种食品含有**低钙**。
### 与预防癌症的饮食建议的关联
### 与预防高血压的饮食建议的关联
### 与预防功能性消化不良的饮食建议的关联
### 与控制体重的饮食建议的关联
### 你应该怎么做
---------------------
| quanbinn/Basic-Health-Knowledge-We-Need-To-Learn | chapters/章5-加工食品的分析/香肠和腊肠.md | Markdown | cc0-1.0 | 6,258 | 19.5 | 115 | 0.678746 | false |
$(document).ready( function () {
// Add return on top button
$('body').append('<div id="returnOnTop" title="Retour en haut"> </div>');
// On button click, let's scroll up to top
$('#returnOnTop').click( function() {
$('html,body').animate({scrollTop: 0}, 'slow');
});
});
$(window).scroll(function() {
// If on top fade the bouton out, else fade it in
if ( $(window).scrollTop() == 0 )
$('#returnOnTop').fadeOut();
else
$('#returnOnTop').fadeIn();
}); | samszo/THYP-1516 | FatihiZakaria/trombino/returnOnTop.js | JavaScript | cc0-1.0 | 497 | 28.294118 | 82 | 0.575453 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Re: [Partido Pirata] Res: Reunião do Partido Pirat a</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="114x114" href="https://www.mail-archive.com/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://www.mail-archive.com/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="57x57" href="https://www.mail-archive.com/apple-touch-icon-57x57.png">
<link rel="shortcut icon" href="https://www.mail-archive.com/favicon.ico">
<link rel="contents" href="https://www.mail-archive.com/listapirata@listas.partidopirata.org/thrd2.html#00751" id="c">
<link rel="index" href="https://www.mail-archive.com/listapirata@listas.partidopirata.org/maillist.html#00751" id="i">
<link rel="prev" href="msg00750.html" id="p">
<link rel="next" href="msg00752.html" id="n">
<link rel="alternate" title="listapirata RSS" href="msg00751.html#" type="application/rss+xml">
<link rel="canonical" href="msg00751.html">
<link rel="stylesheet" href="https://www.mail-archive.com/normalize.css" media="screen">
<link rel="stylesheet" href="https://www.mail-archive.com/master.css" media="screen">
<!--[if lt IE 9]>
<link rel="stylesheet" href="/ie.css" media="screen">
<![endif]-->
</head>
<body>
<script language="javascript" type="text/javascript">
document.onkeydown = NavigateThrough;
function NavigateThrough (event)
{
if (!document.getElementById) return;
if (window.event) event = window.event;
if (event.target.tagName == 'INPUT') return;
var link = null;
switch (event.keyCode ? event.keyCode : event.which ? event.which : null) {
case 74:
case 80:
link = document.getElementById ('p');
break;
case 75:
case 78:
link = document.getElementById ('n');
break;
case 73:
link = document.getElementById ('i');
break;
case 67:
link = document.getElementById ('c');
break;
case 69:
link = document.getElementById ('e');
break;
}
if (link && link.href) document.location = link.href;
}
</script>
<div itemscope itemtype="http://schema.org/Article" class="container">
<div class="skipLink">
<a href="msg00751.html#nav">Skip to site navigation (Press enter)</a>
</div>
<div class="content" role="main">
<div class="msgHead">
<h1>
<span class="subject"><a href="https://www.mail-archive.com/search?l=listapirata@listas.partidopirata.org&q=subject:%22Re%5C%3A+%5C%5BPartido+Pirata%5C%5D%09Res%5C%3A+Reuni%C3%A3o+do+Partido+Pirat%09a%22&o=newest" rel="nofollow"><span itemprop="name">Re: [Partido Pirata] Res: Reunião do Partido Pirat a</span></a></span>
</h1>
<p class="darkgray font13">
<span class="sender pipe"><a href="https://www.mail-archive.com/search?l=listapirata@listas.partidopirata.org&q=from:%22Igor+Thiago%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Igor Thiago</span></span></a></span>
<span class="date"><a href="https://www.mail-archive.com/search?l=listapirata@listas.partidopirata.org&q=date:20101229" rel="nofollow"><span itemprop="datePublished" content="2010-12-29T10:05:10-0800">Wed, 29 Dec 2010 10:05:10 -0800</span></a></span>
</p>
</div>
<div itemprop="articleBody" class="msgBody">
<!--X-Body-of-Message-->
<pre>"Se for começar com baixaria, vou pedir pra todo mundo vestir a roupa e ir
embora!"</pre><pre>
AHEUHAUHeAUhuaheuahuHAUHEuAHEUHAUEHuahuHAUEHeahuahuhUAHeuHAue
--
Igor Thiago Vulcão da Silva
Bach. em Ciência da Computação
*Programador Java
WEB Designer*
Contato: (91) 8120-1949
E-mail: vulcaodevelo...@gmail.com
MSN: thiagortven...@hotmail.com
</pre><pre>_______________________________________________
Lista de discussão do Partido Pirata
listapirata@listas.partidopirata.org
<a rel="nofollow" href="http://listas.partidopirata.org/cgi-bin/mailman/listinfo/listapirata">http://listas.partidopirata.org/cgi-bin/mailman/listinfo/listapirata</a>
<a rel="nofollow" href="http://listas.partidopirata.org/cgi-bin/mailman/listinfo">http://listas.partidopirata.org/cgi-bin/mailman/listinfo</a></pre>
</div>
<div class="msgButtons margintopdouble">
<ul class="overflow">
<li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg00750.html">Mensagem anterior</a></li>
<li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="https://www.mail-archive.com/listapirata@listas.partidopirata.org/thrd2.html#00751">Exibir por discussão</a></li>
<li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="https://www.mail-archive.com/listapirata@listas.partidopirata.org/maillist.html#00751">Exibir por data</a></li>
<li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg00752.html">Próxima mensagem</a></li>
</ul>
</div>
<a name="tslice"></a>
<div class="tSliceList margintopdouble">
<ul class="icons monospace">
<li class="icons-email"><span class="subject"><a href="msg00610.html">[Partido Pirata] Res: Reunião do Parti...</a></span> <span class="sender italic">Raphael S. Lapa</span></li>
<li class="icons-email"><span class="subject"><a href="msg00611.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Simone Vollbrecht</span></li>
<li class="icons-email"><span class="subject"><a href="msg00617.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Alessandro Delgado</span></li>
<li class="icons-email"><span class="subject"><a href="msg00620.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Felipe Barros</span></li>
<li class="icons-email"><span class="subject"><a href="msg00738.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Diogo Leal</span></li>
<li class="icons-email"><span class="subject"><a href="msg00739.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Arteiro Marcial</span></li>
<li class="icons-email"><span class="subject"><a href="msg00744.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Igor Thiago</span></li>
<li class="icons-email"><span class="subject"><a href="msg00747.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">cinco</span></li>
<li class="icons-email"><span class="subject"><a href="msg00748.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Luiz Felipe</span></li>
<li class="icons-email"><span class="subject"><a href="msg00750.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Ricardo da Costa Lima</span></li>
<li class="icons-email tSliceCur"><span class="subject">Re: [Partido Pirata] Res: Reunião do Pa...</span> <span class="sender italic">Igor Thiago</span></li>
<li class="icons-email"><span class="subject"><a href="msg00752.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Luiz Felipe</span></li>
<li class="icons-email"><span class="subject"><a href="msg00753.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Igor Thiago</span></li>
<li class="icons-email"><span class="subject"><a href="msg00755.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Luiz Felipe</span></li>
<li class="icons-email"><span class="subject"><a href="msg00756.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Luiz Felipe</span></li>
<li class="icons-email"><span class="subject"><a href="msg00760.html">Re: [Partido Pirata] Res: Reunião do Pa...</a></span> <span class="sender italic">Daniel Siqueira - debatevisual.com</span></li>
<li class="icons-email"><span class="subject"><a href="msg00749.html">[Partido Pirata] Res: Res: Reunião do ...</a></span> <span class="sender italic">Raphael S. Lapa</span></li>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</div>
<div class="overflow msgActions margintopdouble">
<div class="msgReply" >
<h2>
Responder a
</h2>
<form method="POST" action="https://www.mail-archive.com/mailto.php">
<input type="hidden" name="subject" value="Re: [Partido Pirata] Res: Reunião do Partido Pirat a">
<input type="hidden" name="msgid" value="AANLkTikH9hnLKUoFtf28-h06P2RU=HbCdW_B9G4Lm6=N@mail.gmail.com">
<input type="hidden" name="relpath" value="listapirata@listas.partidopirata.org/msg00751.html">
<input type="submit" value=" Igor Thiago ">
</form>
</div>
</div>
</div>
<div class="aside" role="complementary">
<div class="logo">
<a href="https://www.mail-archive.com/"><img src="https://www.mail-archive.com/logo.png" width=247 height=88 alt="The Mail Archive"></a>
</div>
<form class="overflow" action="https://www.mail-archive.com/search" method="get">
<input type="hidden" name="l" value="listapirata@listas.partidopirata.org">
<label class="hidden" for="q">Search the site</label>
<input class="submittext" type="text" id="q" name="q" placeholder="Pesquisar listapirata">
<input class="submitbutton" name="submit" type="image" src="https://www.mail-archive.com/submit.png" alt="Submit">
</form>
<div class="nav margintop" id="nav" role="navigation">
<ul class="icons font16">
<li class="icons-home"><a href="https://www.mail-archive.com/">Início do Arquivo de Correio</a></li>
<li class="icons-list"><a href="index.html" title="c">listapirata - Todas as mensagens</a></li>
<li class="icons-about"><a href="https://www.mail-archive.com/listapirata@listas.partidopirata.org/info.html">listapirata - Acerca da lista</a></li>
<li class="icons-expand"><a href="https://www.mail-archive.com/search?l=listapirata@listas.partidopirata.org&q=subject:%22Re%5C%3A+%5C%5BPartido+Pirata%5C%5D%09Res%5C%3A+Reuni%C3%A3o+do+Partido+Pirat%09a%22&o=newest&f=1" title="e" id="e">Expandir</a></li>
<li class="icons-prev"><a href="msg00750.html" title="p">Mensagem anterior</a></li>
<li class="icons-next"><a href="msg00752.html" title="n">Próxima mensagem</a></li>
</ul>
</div>
<div class="listlogo margintopdouble">
<a href="msg00751.html#"><img src="https://www.mail-archive.com/listapirata@listas.partidopirata.org/logo.png" alt="listapirata"></a>
</div>
<div class="margintopdouble">
</div>
</div>
</div>
<div class="footer" role="contentinfo">
<ul>
<li><a href="https://www.mail-archive.com/">Início do Arquivo de Correio</a></li>
<li><a href="https://www.mail-archive.com/faq.html#newlist">Adicione a sua lista de discussão</a></li>
<li><a href="https://www.mail-archive.com/faq.html">Perguntas Mais Frequentes</a></li>
<li><a href="https://www.mail-archive.com/faq.html#support">Apoio</a></li>
<li><a href="https://www.mail-archive.com/faq.html#privacy">Privacidade</a></li>
<li class="darkgray">AANLkTikH9hnLKUoFtf28-h06P2RU=HbCdW_B9G4Lm6=N@mail.gmail.com</li>
</ul>
</div>
</body>
</html>
| piratas/midiateca | documentos/listapirata/listapirata@listas.partidopirata.org/msg00751.html | HTML | cc0-1.0 | 11,050 | 60.244444 | 329 | 0.706187 | false |
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
const {ipcMain} = require('electron')
const {dialog} = require('electron')
const {Menu} = require('electron')
import {enableLiveReload} from 'electron-compile'
const path = require('path')
const url = require('url')
const fs = require('fs')
enableLiveReload()
//Window Creation
var windowArray = []
exports.windowCount = 0
function createWindow () {
// Create the new browser window.
windowArray.push( new BrowserWindow({width: 800, height: 600}) )
exports.windowCount = windowArray.length
var newWindow = windowArray[exports.windowCount-1]
// windowArray[windowCount-1].maximize()
// and load the index.html of the app.
newWindow.loadURL(url.format({
pathname: path.join(__dirname, 'html/index.html'),
protocol: 'file:',
slashes: true
}))
// Emitted when the window is closed.
newWindow.on('closed', function () {
newWindow = null
})
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
// app.on('activate', function () {
// // On OS X it's common to re-create a window in the app when the
// // dock icon is clicked and there are no other windows open.
// if (mainWindow === null) {
// createWindow()
// }
// })
//Menus
var template = [
{
label: 'File',
submenu: [
{label: 'New Project'},
{label: 'Open Project'},
{label: 'Import File'},
{type: 'separator'},
{label: 'Save'},
{label: 'Save As'},
{label: 'Settings'}
]
},
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'delete'},
{role: 'selectall'}
]
},
{
label: 'Window',
submenu: [
{label: 'New Window', click: createWindow},
{role: 'minimize'},
{type: 'separator'},
{role: 'toggledevtools'},
{role: 'close'}
]
},
]
var mainMenu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(mainMenu)
//File Functions
function importFile (event) {
dialog.showOpenDialog({properties: ['openFile', 'multiSelections']}, (filePaths) => {
console.log(filePaths)
event.sender.send('importer', filePaths)
})
}
//IPC Functions
ipcMain.on('window-manager', (event, arg) => {
console.log(arg)
if (arg == "New Window") { //Create new window
createWindow()
}
})
ipcMain.on('file-manager', (event, arg) => {
console.log(arg)
if (arg == "Import Files") {
importFile(event)
}
})
| samfromcadott/kettle | main.js | JavaScript | cc0-1.0 | 2,539 | 18.835938 | 86 | 0.639622 | false |
from cStringIO import StringIO
from struct import pack, unpack, error as StructError
from .log import log
from .structures import fields
class DBFile(object):
"""
Base class for WDB and DBC files
"""
@classmethod
def open(cls, file, build, structure, environment):
if isinstance(file, basestring):
file = open(file, "rb")
instance = cls(file, build, environment)
instance._readHeader()
instance.setStructure(structure)
instance._rowDynamicFields = 0 # Dynamic fields index, used when parsing a row
instance._readAddresses()
return instance
def __init__(self, file=None, build=None, environment=None):
self._addresses = {}
self._values = {}
self.file = file
self.build = build
self.environment = environment
def __repr__(self):
return "%s(file=%r, build=%r)" % (self.__class__.__name__, self.file, self.build)
def __contains__(self, id):
return id in self._addresses
def __getitem__(self, item):
if isinstance(item, slice):
keys = sorted(self._addresses.keys())[item]
return [self[k] for k in keys]
if item not in self._values:
self._parse_row(item)
return self._values[item]
def __setitem__(self, item, value):
if not isinstance(item, int):
raise TypeError("DBFile indices must be integers, not %s" % (type(item)))
if isinstance(value, DBRow):
self._values[item] = value
self._addresses[item] = -1
else:
# FIXME technically we should allow DBRow, but this is untested and will need resetting parent
raise TypeError("Unsupported type for DBFile.__setitem__: %s" % (type(value)))
def __delitem__(self, item):
if item in self._values:
del self._values[item]
del self._addresses[item]
def __iter__(self):
return self._addresses.__iter__()
def __len__(self):
return len(self._addresses)
def _add_row(self, id, address, reclen):
if id in self._addresses: # Something's wrong here
log.warning("Multiple instances of row %r found in %s" % (id, self.file.name))
self._addresses[id] = (address, reclen)
def _parse_field(self, data, field, row=None):
"""
Parse a single field in stream.
"""
if field.dyn > self._rowDynamicFields:
return None # The column doesn't exist in this row, we set it to None
ret = None
try:
if isinstance(field, fields.StringField):
ret = self._parse_string(data)
elif isinstance(field, fields.DataField): # wowcache.wdb
length = getattr(row, field.master)
ret = data.read(length)
elif isinstance(field, fields.DynamicMaster):
ret, = unpack("<I", data.read(4))
self._rowDynamicFields = ret
else:
ret, = unpack("<%s" % (field.char), data.read(field.size))
except StructError:
log.warning("Field %s could not be parsed properly" % (field))
ret = None
return ret
def supportsSeeking(self):
return hasattr(self.file, "seek")
def append(self, row):
"""
Append a row at the end of the file.
If the row does not have an id, one is automatically assigned.
"""
i = len(self) + 1 # FIXME this wont work properly in incomplete files
if "_id" not in row:
row["_id"] = i
self[i] = row
def clear(self):
"""
Delete every row in the file
"""
for k in self.keys(): # Use key, otherwise we get RuntimeError: dictionary changed size during iteration
del self[k]
def keys(self):
return self._addresses.keys()
def items(self):
return [(k, self[k]) for k in self]
def parse_row(self, data, reclen=0):
"""
Assign data to a DBRow instance
"""
return DBRow(self, data=data, reclen=reclen)
def values(self):
"""
Return a list of the file's values
"""
return [self[id] for id in self]
def setRow(self, key, **values):
self.__setitem__(key, DBRow(self, columns=values))
def size(self):
if hasattr(self.file, "size"):
return self.file.size()
elif isinstance(self.file, file):
from os.path import getsize
return getsize(self.file.name)
raise NotImplementedError
def update(self, other):
"""
Update file from iterable other
"""
for k in other:
self[k] = other[k]
def write(self, filename=""):
"""
Write the file data on disk. If filename is not given, use currently opened file.
"""
_filename = filename or self.file.name
data = self.header.data() + self.data() + self.eof()
f = open(_filename, "wb") # Don't open before calling data() as uncached rows would be empty
f.write(data)
f.close()
log.info("Written %i bytes at %s" % (len(data), f.name))
if not filename: # Reopen self.file, we modified it
# XXX do we need to wipe self._values here?
self.file.close()
self.file = open(f.name, "rb")
class DBRow(list):
"""
A database row.
Names of the variables of that class should not be used in field names of structures
"""
initialized = False
def __init__(self, parent, data=None, columns=None, reclen=0):
self._parent = parent
self._values = {} # Columns values storage
self.structure = parent.structure
self.initialized = True # needed for __setattr__
if columns:
if type(columns) == list:
self.extend(columns)
elif type(columns) == dict:
self._default()
_cols = [k.name for k in self.structure]
for k in columns:
try:
self[_cols.index(k)] = columns[k]
except ValueError:
log.warning("Column %r not found" % (k))
elif data:
dynfields = 0
data = StringIO(data)
for field in self.structure:
_data = parent._parse_field(data, field, self)
self.append(_data)
if reclen:
real_reclen = reclen + self._parent.row_header_size
if data.tell() != real_reclen:
log.warning("Reclen not respected for row %r. Expected %i, read %i. (%+i)" % (self.id, real_reclen, data.tell(), real_reclen-data.tell()))
def __dir__(self):
result = self.__dict__.keys()
result.extend(self.structure.column_names)
return result
def __getattr__(self, attr):
if attr in self.structure:
return self._get_value(attr)
if attr in self.structure._abstractions: # Union abstractions etc
field, func = self.structure._abstractions[attr]
return func(field, self)
if "__" in attr:
return self._query(attr)
return super(DBRow, self).__getattribute__(attr)
def __int__(self):
return self.id
def __setattr__(self, attr, value):
# Do not preserve the value in DBRow! Use the save method to save.
if self.initialized and attr in self.structure:
self._set_value(attr, value)
return super(DBRow, self).__setattr__(attr, value)
def __setitem__(self, index, value):
if not isinstance(index, int):
raise TypeError("Expected int instance, got %s instead (%r)" % (type(index), index))
list.__setitem__(self, index, value)
col = self.structure[index]
self._values[col.name] = col.to_python(value, row=self)
def _get_reverse_relation(self, table, field):
"""
Return a list of rows matching the reverse relation
"""
if not hasattr(self._parent, "_reverse_relation_cache"):
self._parent._reverse_relation_cache = {}
cache = self._parent._reverse_relation_cache
tfield = table + "__" + field
if tfield not in cache:
cache[tfield] = {}
# First time lookup, let's build the cache
table = self._parent.environment.dbFile(table)
for row in table:
row = table[row]
id = row._raw(field)
if id not in cache[tfield]:
cache[tfield][id] = []
cache[tfield][id].append(row)
return cache[tfield].get(self.id, None)
def _matches(self, **kwargs):
for k, v in kwargs.items():
if not self._query(k, v):
return False
return True
def _query(self, rel, value=None):
"""
Parse a django-like multilevel relationship
"""
rels = rel.split("__")
if "" in rels: # empty string
raise ValueError("Invalid relation string")
first = rels[0]
if not hasattr(self, first):
if self._parent.environment.hasDbFile(first):
# Handle reverse relations, eg spell__item for item table
remainder = rel[len(first + "__"):]
return self._get_reverse_relation(first, remainder)
raise ValueError("Invalid relation string")
ret = self
rels = rels[::-1]
special = {
"contains": lambda x, y: x in y,
"exact": lambda x, y: x == y,
"icontains": lambda x, y: x.lower() in y.lower(),
"iexact": lambda x, y: x.lower() == y.lower(),
"gt": lambda x, y: x > y,
"gte": lambda x, y: x >= y,
"lt": lambda x, y: x < y,
"lte": lambda x, y: x <= y,
}
while rels:
if rels[-1] in special:
if len(rels) != 1:
# icontains always needs to be the last piece of the relation string
raise ValueError("Invalid relation string")
return special[rels[-1]](value, ret)
else:
ret = getattr(ret, rels.pop())
return ret
def _set_value(self, name, value):
index = self.structure.index(name)
col = self.structure[index]
self._values[name] = col.to_python(value, self)
self[index] = value
def _get_value(self, name):
if name not in self._values:
raw_value = self[self.structure.index(name)]
self._set_value(name, raw_value)
return self._values[name]
def _raw(self, name):
"""
Returns the raw value from field 'name'
"""
index = self.structure.index(name)
return self[index]
def _save(self):
for name in self._values:
index = self.structure.index(name)
col = self.structure[index]
self[index] = col.from_python(self._values[name])
def _field(self, name):
"""
Returns the field 'name'
"""
index = self.structure.index(name)
return self.structure[index]
def _default(self):
"""
Change all fields to their default values
"""
del self[:]
self._values = {}
for col in self.structure:
char = col.char
if col.dyn:
self.append(None)
elif char == "s":
self.append("")
elif char == "f":
self.append(0.0)
else:
self.append(0)
def dict(self):
"""
Return a dict of the row as colname: value
"""
return dict(zip(self.structure.column_names, self))
def update(self, other):
for k in other:
self[k] = other[k]
@property
def id(self):
"Temporary hack to transition between _id and id"
return self._id
| jleclanche/pywow | wdbc/main.py | Python | cc0-1.0 | 10,011 | 24.801546 | 143 | 0.652982 | false |
# GyroSpiro
<strong> <blue> A Digital Whirlygig written in C </blue> </strong>
## Materials
(1) [An Arduino](www.arduino.cc)<br>

<br>(2) A single LED<br>

<br>(3) The Arduino IDE<br>
<em>The Arduino Integrated Development Environment is simple and easy to use! Download it [here](https://www.arduino.cc/en/Main/OldSoftwareReleases)</em>
## Setup
* If you're an Arduino first-timer, follow the setup instructions for your partiular operating system [here](https://www.arduino.cc/en/Guide/HomePage).
* (...[HERE](https://www.arduino.cc/en/Guide/MacOSX) is a handy set of installation info for Mac OS X)
* With Arduino board in hand, push one metallic 'leg' of the LED light into DIGITAL PIN 13 and let the other 'leg' pop into the neighboring pin.
* Make sure your Arduino is tethered to your laptop via USB connector, and that the Ardunio IDE is open. Hit Cmd+N to create NEW instructions for it, and paste the Gyro code in!
* Hit UPLOAD and watch the magic!
### Details
The Arduino has input channels, output channels, and power. The input channels, or PINs, are conductive metallic pins awaiting electronic data - in this case in binary 1111101010100101010. We can send 0 and 1 signals using C with the commands digitalWrite LOW and digitalWrite HIGH. The LED receives these as Off and On signals.
When we send these Off/On signals at a certain pace, the LED gives us the illusion of spinning like a gyroscope does.

<p xmlns:dct="http://purl.org/dc/terms/">
<a rel="license" href="http://creativecommons.org/publicdomain/mark/1.0/">
<img src="http://i.creativecommons.org/p/mark/1.0/88x31.png"
style="border-style: none;" alt="Public Domain Mark" />
</a>
<br />
This work (<span property="dct:title">Gyro</span>, by <a href="https://github.com/DhiMalo/GyroSpiro" rel="dct:creator"><span property="dct:title">Aheri Stanford-Asiyo</span></a>), is free of known copyright restrictions.
</p>
| DhiMalo/GyroSpiro | README.md | Markdown | cc0-1.0 | 2,172 | 64.818182 | 332 | 0.746777 | false |
// npm
var chalk = require('chalk')
// local
var Copper = require('../copper')
var copper = new Copper
var util = require('../util')
module.exports = function (config, wallet, keys, args) {
var abort = false
var name
if (args._.length > 0) {
name = args._.join(' ')
}
var key = copper.newKey()
console.log(' pub:', chalk.green(key.pub))
console.log('priv:', chalk.blue(key.priv))
var wkey = {pub: key.pub, priv: key.priv, date: new Date()}
if (name) {
var keynames = wallet.keys.map(function (k) {return k.name})
if (keynames.indexOf(name) > -1) {
console.log('abort!', chalk.red('key named', name, 'already exists'))
abort = true
} else {
wkey.name = name
console.log('name:', JSON.stringify(wkey.name))
}
}
if (!abort) {
wallet.keys.push(wkey)
util.saveJSON(config.wallet.file, wallet)
}
}
| donpdonp/coindust | lib/commands/new.js | JavaScript | cc0-1.0 | 874 | 22.621622 | 75 | 0.601831 | false |
html, body{
height: 100%;
overflow: hidden;
}
.present{
background-color: #00838F;
}
md-divider{
margin-top: 5px;
}
md-list{
padding: 0px;
}
#listInfo{
color: white;
background-color: #263238;
}
#logo_placeholder{
border-radius: 100%;
background-color: #455A64;
width:200px;
height:200px;
margin-bottom: 16px;
line-height: 200px;
text-align: center;
vertical-align: middle;
}
.md-button:not(.md-fab) {
min-width: 10em;
}
.centerH{
margin: auto;
text-align: center;
}
.active{
background-color: #00838F;
}
| abhijitk7/Attendance | attendance/src/main/resources/static/css/stylesheet.css | CSS | epl-1.0 | 585 | 12 | 30 | 0.613675 | false |
/* file "ia64/instr.cpp" */
/*
Copyright (c) 2002 The President and Fellows of Harvard College
All rights reserved.
This software is provided under the terms described in
the "machine/copyright.h" include file.
*/
#include <machine/copyright.h>
#ifdef USE_PRAGMA_INTERFACE
#pragma implementation "ia64/instr.h"
#endif
#include <machine/machine.h>
#include <ia64/opcodes.h>
#include <ia64/reg_info.h>
#include <ia64/instr.h>
#ifdef USE_DMALLOC
#include <dmalloc.h>
#define new D_NEW
#endif
using namespace ia64;
/* ---------------- is_* helper routines ------------------- */
bool
is_ldc_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
return ((s == MOV_IMM) || (s == MOVL));
}
/*
* Unconditional register-to-register copy within a single register file.
*/
bool
is_move_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
if (((s == MOV_GR) || (s == MOV_FR)) && !is_predicated(mi)) return true;
else return false;
}
bool
is_cmove_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
if ((s >= MOV_AR) && (s <= MOVL) && is_predicated(mi)) return true;
else return false;
}
bool
has_qpred(Instr *mi)
{
if (srcs_size(mi) < 1) return false;
int loc = srcs_size(mi) - 1;
Opnd predOpnd = get_src(mi, loc);
if (is_preg(predOpnd)) return true;
else return false;
}
/*
* Set qualifying predicate
* This routine adds a qualifying predicate to the instruction
* i.e. (qp) mov dst = src
*/
void
set_qpred(Instr *mi, Opnd qp)
{
claim(is_preg(qp), "Attempting to add qp that isn't a preg");
if (has_qpred(mi))
set_src(mi, (srcs_size(mi)-1), qp);
else
append_src(mi, qp);
}
/*
* Returns the qualifying predicate of the instruction or an error
*/
Opnd
get_qpred(Instr *mi)
{
Opnd predOpnd;
if (has_qpred(mi))
predOpnd = get_src(mi, (srcs_size(mi)-1));
else
claim(false, "Oops, no predicate set on instruction!");
return predOpnd;
}
bool
is_predicated_ia64(Instr *mi)
{
if (!has_qpred(mi)) return false;
Opnd predOpnd = get_qpred(mi);
if (predOpnd != opnd_pr_const1) return true;
else return false;
}
bool
is_line_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
return (s == LN);
}
bool
is_ubr_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
return (((s == BR) || (s == BRL)) &&
!is_predicated(mi) &&
!is_call_ia64(mi) &&
!is_return_ia64(mi) &&
!is_mbr(mi));
}
bool
is_cbr_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
return (((s == BR) || (s == BRL)) &&
is_predicated(mi) &&
!is_call_ia64(mi) &&
!is_return_ia64(mi) &&
!is_mbr(mi));
}
bool
is_call_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
if ((s == BR) || (s == BRL)) {
if (get_br_ext(o, 1) == BTYPE_CALL) return true;
}
return false;
}
bool
is_return_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
if ((s == BR) || (s == BRL)) {
if (get_br_ext(o, 1) == BTYPE_RET) return true;
}
else if (s == RFI) return true;
return false;
}
bool
is_triary_exp_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
switch (s) {
case FMA: case FMS: case FNMA: case FPMA: case FPMS:
case FPNMA: case FSELECT: case PSHLADD: case PSHRADD:
case SHLADD: case SHLADDP4: case SHRP: case XMA:
return true;
default:
return false;
}
}
bool
is_binary_exp_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
switch (s) {
case ADD: case ADDP4: case AND: case ANDCM: case CMP:
case CMP4: case CMPXCHG: case FADD: case FAMAX: case FAMIN:
case FAND: case FANDCM: case FCMP: case FMAX: case FMERGE:
case FMIN: case FMIX: case FMPY: case FNMPY: case FOR:
case FPACK: case FPAMAX: case FPAMIN: case FPCMP:
case FPMAX: case FPMERGE: case FPMIN: case FPMPY:
case FPNMPY: case FPRCPA: case FRCPA: case FSUB:
case FSWAP: case FSXT: case FXOR: case MIX: case OR:
case PACK: case PADD: case PAVG: case PAVGSUB: case PCMP:
case PMAX: case PMIN: case PMPY: case PROBE: case PSAD:
case PSHL: case PSHR: case PSUB: case SHL: case SHR:
case SUB: case TBIT: case UNPACK: case XMPY: case XOR:
return true;
default:
return false;
}
}
bool
is_unary_exp_ia64(Instr *mi)
{
int o = get_opcode(mi);
int s = get_stem(o);
switch (s) {
case CZX: case FABS: case FCVT_FX: case FCVT_XF: case FCVT_XUF:
case FNEG: case FNEGABS: case FNORM: case FPCVT_FX: case FPNEG:
case FPNEGABS: case FPRSQRTA: case FRSQRTA: case GETF:
case POPCNT: case SETF: case SXT: case TAK: case THASH:
case TNAT: case TPA: case TTAG: case ZXT:
return true;
default:
return false;
}
}
bool
is_commutative_ia64(Instr *mi)
{
int opc = get_opcode(mi);
int st = get_stem(opc);
switch (st) {
case ADD: case ADDP4: case AND: case OR:
/* The above have an immediate form that cannot be reversed */
return !is_immed(get_src(mi, 1));
case CMP: case CMP4:
/* The next set have relational operators that can only
be reversed if they are set to "EQUAL" */
return (get_ext(opc, 1) == CREL_EQ);
case FCMP: case FPCMP:
return (get_ext(opc, 1) == FREL_EQ);
case PCMP:
return (get_ext(opc, 1) == PREL_EQ);
case FADD: case FAMAX: case FAMIN: case FAND:
case FMAX: case FMIN: case FMPY: case FNMPY:
case FOR: case FPAMAX: case FPAMIN: case FPMAX:
case FPMIN: case FPMPY: case FPNMPY: case FXOR:
case PADD: case PAVG: case PMAX: case PMIN:
case PMPY: case PSAD: case XMPY: case XOR:
return true;
default:
return false;
}
}
bool
is_two_opnd_ia64(Instr *instr)
{
return false;
}
bool
reads_memory_ia64(Instr *instr)
{
int o = get_opcode(instr);
int s = get_stem(o);
switch (s) {
case CMPXCHG: case FETCHADD: case LD: case LDF:
case LDFP: case LFETCH: case XCHG:
return true;
default:
return false;
}
}
bool
writes_memory_ia64(Instr *instr)
{
int o = get_opcode(instr);
int s = get_stem(o);
switch (s) {
case ST:
case STF:
return true;
default:
return false;
}
}
| nxt4hll/roccc-2.0 | roccc-compiler/src/NuSuif/machsuif/z_notneeded/ia64/instr.cpp | C++ | epl-1.0 | 6,354 | 20.686007 | 76 | 0.597419 | false |
/*******************************************************************************
* Copyright (c) 2021 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 com.ibm.ws.jpa.tests.spec10.entity;
import org.junit.ClassRule;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import com.ibm.ws.jpa.tests.spec10.entity.tests.AbstractFATSuite;
import com.ibm.ws.jpa.tests.spec10.entity.tests.Entity_EJB;
import com.ibm.ws.jpa.tests.spec10.entity.tests.Entity_Web;
import componenttest.rules.repeater.FeatureReplacementAction;
import componenttest.rules.repeater.RepeatTests;
@RunWith(Suite.class)
@SuiteClasses({
Entity_EJB.class,
Entity_Web.class,
componenttest.custom.junit.runner.AlwaysPassesTest.class
})
public class FATSuite extends AbstractFATSuite {
@ClassRule
public static RepeatTests r = RepeatTests.with(FeatureReplacementAction.EE9_FEATURES());
}
| kgibm/open-liberty | dev/com.ibm.ws.jpa.tests.spec10.entity_jpa_3.0_fat/fat/src/com/ibm/ws/jpa/tests/spec10/entity/FATSuite.java | Java | epl-1.0 | 1,362 | 35.810811 | 92 | 0.671072 | false |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 23 08:32:56 PST 2011 -->
<TITLE>
SerialBTDevice.InvalidBluetoothAddressException
</TITLE>
<META NAME="date" CONTENT="2011-12-23">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SerialBTDevice.InvalidBluetoothAddressException";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SerialBTDevice.InvalidBluetoothAddressException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/t2/biofeedback/device/SerialBTDevice.DeviceNotBondedException.html" title="class in com.t2.biofeedback.device"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/t2/biofeedback/device/SerialBTDevice.InvalidBluetoothAddressException.html" target="_top"><B>FRAMES</B></A>
<A HREF="SerialBTDevice.InvalidBluetoothAddressException.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.t2.biofeedback.device</FONT>
<BR>
Class SerialBTDevice.InvalidBluetoothAddressException</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">java.lang.Throwable
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">java.lang.Exception
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">java.lang.RuntimeException
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.t2.biofeedback.device.SerialBTDevice.InvalidBluetoothAddressException</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD>
</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../../com/t2/biofeedback/device/SerialBTDevice.html" title="class in com.t2.biofeedback.device">SerialBTDevice</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>SerialBTDevice.InvalidBluetoothAddressException</B><DT>extends java.lang.RuntimeException</DL>
</PRE>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#com.t2.biofeedback.device.SerialBTDevice.InvalidBluetoothAddressException">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/t2/biofeedback/device/SerialBTDevice.InvalidBluetoothAddressException.html#SerialBTDevice.InvalidBluetoothAddressException(java.lang.String)">SerialBTDevice.InvalidBluetoothAddressException</A></B>(java.lang.String msg)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Throwable</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SerialBTDevice.InvalidBluetoothAddressException(java.lang.String)"><!-- --></A><H3>
SerialBTDevice.InvalidBluetoothAddressException</H3>
<PRE>
public <B>SerialBTDevice.InvalidBluetoothAddressException</B>(java.lang.String msg)</PRE>
<DL>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SerialBTDevice.InvalidBluetoothAddressException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/t2/biofeedback/device/SerialBTDevice.DeviceNotBondedException.html" title="class in com.t2.biofeedback.device"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/t2/biofeedback/device/SerialBTDevice.InvalidBluetoothAddressException.html" target="_top"><B>FRAMES</B></A>
<A HREF="SerialBTDevice.InvalidBluetoothAddressException.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Throwable">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| t2health/BSPAN---Bluetooth-Sensor-Processing-for-Android | AndroidBTService/doc/com/t2/biofeedback/device/SerialBTDevice.InvalidBluetoothAddressException.html | HTML | epl-1.0 | 10,981 | 43.004098 | 269 | 0.63965 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Defensive Programming" />
<meta name="DC.Relation" scheme="URI" content="GUID-35D7EEFC-B2E4-5444-8875-2A24790E08C2.html" />
<meta name="DC.Relation" scheme="URI" content="index.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-35D7EEFC-B2E4-5444-8875-2A24790E08C2.html" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285" />
<meta name="DC.Language" content="en" />
<link rel="stylesheet" type="text/css" href="commonltr.css" />
<title>
Defensive Programming
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="nokiacxxref.css" />
</head>
<body id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id1197760 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
<a href="GUID-35D7EEFC-B2E4-5444-8875-2A24790E08C2.html">
Essential Idioms
</a>
>
</div>
<h1 class="topictitle1">
Defensive Programming
</h1>
<div>
<p>
To help Symbian developers identify potential problems early in development, macros are provided to test for error conditions in functions (asserts) and objects (class invariants). Casting is one well known source of hard-to-find errors.
<a href="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285.html#GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-A0253DF3-098C-5427-9B45-3CEC4F4875AB">
Casting
</a>
discusses its use.
</p>
<div class="section" id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-55EB9D07-65F1-572B-8F36-9A442F69B9C2">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-55EB9D07-65F1-572B-8F36-9A442F69B9C2">
<!-- -->
</a>
<h2 class="sectiontitle">
Testing conditions with asserts and invariants
</h2>
<p>
One method of catching errors early is to identify conditions that should be true at the beginning and end of functions, and raise errors if they are not.
</p>
<p>
Two mechanisms support this programming style.
</p>
<ul>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-620C4F53-5465-5A53-9880-7DC27EF752FF">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-620C4F53-5465-5A53-9880-7DC27EF752FF">
<!-- -->
</a>
<p>
asserts
</p>
</li>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-9A1881EA-4C72-5359-9D16-553806070556">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-9A1881EA-4C72-5359-9D16-553806070556">
<!-- -->
</a>
<p>
class invariants
</p>
</li>
</ul>
<p>
<strong>
Asserts
</strong>
</p>
<p>
Two macros are supplied for asserting specific conditions in functions:
</p>
<ul>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-9481684E-5E9D-54B1-87E0-3539F4A29157">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-9481684E-5E9D-54B1-87E0-3539F4A29157">
<!-- -->
</a>
<p>
<samp class="codeph">
__ASSERT_ALWAYS
</samp>
to catch run-time invalid input, for both release and debug builds
</p>
</li>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-4BAF939D-03D4-5D1E-A1BD-79537D930E93">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-4BAF939D-03D4-5D1E-A1BD-79537D930E93">
<!-- -->
</a>
<p>
<samp class="codeph">
__ASSERT_DEBUG
</samp>
to catch programming errors, for debug builds only
</p>
</li>
</ul>
<p>
<strong>
Class Invariants
</strong>
</p>
<p>
Class invariants are used to test that an object is in a valid state. They are used only in debug builds.
</p>
<ul>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-F79328BA-61FD-5CB6-9D09-4C4DF6A2459B">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-F79328BA-61FD-5CB6-9D09-4C4DF6A2459B">
<!-- -->
</a>
<p>
Define class invariants for non-trivial classes using
<samp class="codeph">
__DECLARE_TEST
</samp>
. The class must supply functions that specify its allowed stable states.
</p>
</li>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-541758DE-21E9-5599-A12B-0208867240CA">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-541758DE-21E9-5599-A12B-0208867240CA">
<!-- -->
</a>
<p>
To ensures that the object is in a stable state prior to executing the function, call the invariant at the start of all public functions using
<samp class="codeph">
__TEST_INVARIANT
</samp>
.
</p>
</li>
<li id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-20FFC383-0371-5494-8887-D0B3888162EE">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-20FFC383-0371-5494-8887-D0B3888162EE">
<!-- -->
</a>
<p>
For non-const functions, you can ensure that the object has been left in a stable state by also calling the invariant at the end of the function.
</p>
</li>
</ul>
</div>
<div class="section" id="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-A0253DF3-098C-5427-9B45-3CEC4F4875AB">
<a name="GUID-D5FD665E-333B-50FF-A46F-6B22C0877285__GUID-A0253DF3-098C-5427-9B45-3CEC4F4875AB">
<!-- -->
</a>
<h2 class="sectiontitle">
Casting
</h2>
<p>
Casts, as in other operating systems, should be used with caution. If a cast seems to be needed, check that this does not reflect a design weakness.
</p>
<p>
The C++
<samp class="codeph">
dynamic_cast
</samp>
operator should not be used because the Symbian platform does not use C++ exceptions in user code.
</p>
<p>
Note that in early versions of the OS (pre v6.0), the GCC compiler did not support the C++ casting operators. The idiom was then to use instead one of the macros
<samp class="codeph">
REINTERPRET_CAST
</samp>
,
<samp class="codeph">
STATIC_CAST
</samp>
,
<samp class="codeph">
CONST_CAST
</samp>
, and
<samp class="codeph">
MUTABLE_CAST
</samp>
, which were defined as simple C style casts for that compiler.
</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink">
<strong>
Parent topic:
</strong>
<a href="GUID-35D7EEFC-B2E4-5444-8875-2A24790E08C2.html">
Essential Idioms
</a>
</div>
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-D5FD665E-333B-50FF-A46F-6B22C0877285.html | HTML | epl-1.0 | 8,847 | 36.176471 | 243 | 0.613315 | false |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TB9.2 Example Applications: SemaphoreExample</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
<link type="text/css" rel="stylesheet" href="../css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="../css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="../css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
</head>
<body class="kernelguide">
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Product Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0;
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<!-- Generated by Doxygen 1.6.2 -->
<div class="contents">
<h1><a class="anchor" id="guid-34775913-c5c2-41ba-a591-827039bbe7af">SemaphoreExample </a></h1><p>Source files:</p>
<ul>
<li><a href="_base_2_semaphore_example_2group_2_bld_8inf_source.html">group\bld.inf</a></li>
<li><a href="_semaphore_example_8mmp_source.html">group\SemaphoreExample.mmp</a></li>
<li><a href="_c_database_8h_source.html">inc\CDatabase.h</a></li>
<li><a href="_semaphore_example_8h_source.html">inc\SemaphoreExample.h</a></li>
<li><a href="_c_database_8cpp_source.html">src\CDatabase.cpp</a></li>
<li><a href="_semaphore_example_8cpp_source.html">src\SemaphoreExample.cpp</a> </li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html>
| warlordh/fork_Symbian | sdk/guid-6013a680-57f9-415b-8851-c4fa63356636/guid-34775913-c5c2-41ba-a591-827039bbe7af.html | HTML | epl-1.0 | 2,638 | 41.548387 | 163 | 0.669067 | false |
/*
* Copyright (c) 2013 Cisco Systems, Inc. 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
*/
package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
import javax.management.ObjectName;
import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
@ServiceInterfaceAnnotation(value = TestingParallelAPSPConfigMXBean.NAME, osgiRegistrationType = TestingAPSP.class)
public interface TestingParallelAPSPConfigMXBean {
static final String NAME = "apsp";
ObjectName getThreadPool();
void setThreadPool(ObjectName threadPoolName);
String getSomeParam();
void setSomeParam(String s);
// for reporting. this should be moved to runtime jmx bean
Integer getMaxNumberOfThreads();
}
| xiaohanz/softcontroller | opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPConfigMXBean.java | Java | epl-1.0 | 972 | 31.4 | 115 | 0.782922 | false |
/*
* (C) Copyright 2017 Netcentric AG.
*
* 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
*/
package biz.netcentric.cq.tools.actool.configreader;
import java.util.Map;
import biz.netcentric.cq.tools.actool.configmodel.AceBean;
import biz.netcentric.cq.tools.actool.configmodel.AuthorizableConfigBean;
import biz.netcentric.cq.tools.actool.validators.exceptions.AcConfigBeanValidationException;
/** Subclass of YamlConfigReader only used for unit tests. Overrides bean setup-methods from YamlConfigReader to set up TestAceBean and
* TestAuthorizableConfigBean in order to set the assertedExceptionString set in test yaml files for later evaluation in unit tests. Also
* overrides getNewAceBean() and getNewAuthorizableConfigBean() to return the correct testing type in order to make the downcast in
* overridden setup-methods possible.
*
* @author jochenkoschorke */
public class TestYamlConfigReader extends YamlConfigReader {
protected final String ASSERTED_EXCEPTION = "assertedException";
@Override
protected void setupAceBean(final String principal,
final Map<String, ?> currentAceDefinition, final AceBean tmpAclBean, String sourceFile) {
super.setupAceBean(principal, currentAceDefinition, tmpAclBean, sourceFile);
((TestAceBean) tmpAclBean).setAssertedExceptionString(getMapValueAsString(
currentAceDefinition, ASSERTED_EXCEPTION));
}
@Override
protected void setupAuthorizableBean(
final AuthorizableConfigBean authorizableConfigBean,
final Map<String, Object> currentPrincipalDataMap,
final String authorizableId,
boolean isGroupSection) throws AcConfigBeanValidationException {
super.setupAuthorizableBean(authorizableConfigBean, currentPrincipalDataMap, authorizableId, isGroupSection);
((TestAuthorizableConfigBean) authorizableConfigBean).setAssertedExceptionString(getMapValueAsString(
currentPrincipalDataMap, ASSERTED_EXCEPTION));
}
@Override
protected AceBean getNewAceBean() {
return new TestAceBean();
}
@Override
protected AuthorizableConfigBean getNewAuthorizableConfigBean() {
return new TestAuthorizableConfigBean();
}
}
| Netcentric/accesscontroltool | accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/TestYamlConfigReader.java | Java | epl-1.0 | 2,450 | 42.75 | 137 | 0.764898 | false |
/**
* Created by visual studio 2010
* User: xuheng
* Date: 12-3-6
* Time: 下午21:23
* To get the value of editor and output the value .
*/
using System;
using System.Web;
namespace FineUI.Examples
{
public class getContent : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";
//获取数据
string content = context.Server.HtmlEncode(context.Request.Form["myEditor"]);
string content1 = context.Server.HtmlEncode(context.Request.Form["myEditor1"]);
//存入数据库或者其他操作
//-------------
//显示
context.Response.Write("<script src='../uparse.js' type='text/javascript'></script>");
context.Response.Write(
"<script>uParse('.content',{" +
"'highlightJsUrl':'../third-party/SyntaxHighlighter/shCore.js'," +
"'highlightCssUrl':'../third-party/SyntaxHighlighter/shCoreDefault.css'" +
"})" +
"</script>");
context.Response.Write("第1个编辑器的值");
context.Response.Write("<div class='content'>" + context.Server.HtmlDecode(content) + "</div>");
context.Response.Write("<br/>第2个编辑器的值<br/>");
context.Response.Write("<textarea class='content' style='width:500px;height:300px;'>" + context.Server.HtmlDecode(content1) + "</textarea><br/>");
}
public bool IsReusable
{
get
{
return false;
}
}
}
} | proson/project | FineUI.Examples/ueditor/net/getContent.ashx.cs | C# | epl-1.0 | 1,663 | 28.592593 | 158 | 0.54665 | false |
/*******************************************************************************
* Copyright (c) 2004 Actuate Corporation.
* 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:
* Actuate Corporation - initial API and implementation
* Ing. Gerd Stockner (Mayr-Melnhof Karton Gesellschaft m.b.H.) - modifications
* Christian Voller (Mayr-Melnhof Karton Gesellschaft m.b.H.) - modifications
* CoSMIT GmbH - publishing, maintenance
*******************************************************************************/
package com.mmkarton.mx7.reportgenerator.sqledit;
import java.sql.Types;
import java.text.Bidi;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.datatools.connectivity.oda.IParameterMetaData;
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.design.DataSetParameters;
import org.eclipse.datatools.connectivity.oda.design.DesignFactory;
import org.eclipse.datatools.connectivity.oda.design.ParameterDefinition;
import org.eclipse.datatools.connectivity.oda.design.ParameterMode;
import org.eclipse.datatools.connectivity.oda.design.ResultSetColumns;
import org.eclipse.datatools.connectivity.oda.design.ResultSetDefinition;
import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;
import com.mmkarton.mx7.reportgenerator.engine.SQLQuery;
import com.mmkarton.mx7.reportgenerator.jdbc.ResultSetMetaData;
import com.mmkarton.mx7.reportgenerator.wizards.BIRTReportWizard;
/**
* The utility class for SQLDataSetEditorPage
*
*/
public class SQLUtility
{
/**
* save the dataset design's metadata info
*
* @param design
*/
public static SQLQuery getBIRTSQLFields(String sqlQueryText) {
MetaDataRetriever retriever = new MetaDataRetriever( addDummyWhere(sqlQueryText));
IResultSetMetaData resultsetMeta = retriever.getResultSetMetaData( );
IParameterMetaData paramMeta = retriever.getParameterMetaData( );
return saveDataSetDesign( resultsetMeta, paramMeta ,sqlQueryText);
}
public static SQLQuery saveDataSetDesign( IResultSetMetaData meta, IParameterMetaData paramMeta, String sqlQueryText )
{
try
{
setParameterMetaData( paramMeta );
// set resultset metadata
return setResultSetMetaData(meta, sqlQueryText );
}
catch ( OdaException e )
{
return null;
}
}
/**
* Set parameter metadata in dataset design
*
* @param design
* @param query
*/
private static void setParameterMetaData(IParameterMetaData paramMeta )
{
try
{
// set parameter metadata
mergeParameterMetaData( paramMeta );
}
catch ( OdaException e )
{
// do nothing, to keep the parameter definition in dataset design
// dataSetDesign.setParameters( null );
}
}
/**
* solve the BIDI line problem
* @param lineText
* @return
*/
public static int[] getBidiLineSegments( String lineText )
{
int[] seg = null;
if ( lineText != null
&& lineText.length( ) > 0
&& !new Bidi( lineText, Bidi.DIRECTION_LEFT_TO_RIGHT ).isLeftToRight( ) )
{
List list = new ArrayList( );
// Punctuations will be regarded as delimiter so that different
// splits could be rendered separately.
Object[] splits = lineText.split( "\\p{Punct}" );
// !=, <> etc. leading to "" will be filtered to meet the rule that
// segments must not have duplicates.
for ( int i = 0; i < splits.length; i++ )
{
if ( !splits[i].equals( "" ) )
list.add( splits[i] );
}
splits = list.toArray( );
// first segment must be 0
// last segment does not necessarily equal to line length
seg = new int[splits.length + 1];
for ( int i = 0; i < splits.length; i++ )
{
seg[i + 1] = lineText.indexOf( (String) splits[i], seg[i] )
+ ( (String) splits[i] ).length( );
}
}
return seg;
}
/**
* Return pre-defined query text pattern with every element in a cell.
*
* @return pre-defined query text
*/
public static String getQueryPresetTextString( String extensionId )
{
String[] lines = getQueryPresetTextArray( extensionId );
String result = "";
if ( lines != null && lines.length > 0 )
{
for ( int i = 0; i < lines.length; i++ )
{
result = result
+ lines[i] + ( i == lines.length - 1 ? " " : " \n" );
}
}
return result;
}
/**
* Return pre-defined query text pattern with every element in a cell in an
* Array
*
* @return pre-defined query text in an Array
*/
public static String[] getQueryPresetTextArray( String extensionId )
{
final String[] lines;
if ( extensionId.equals( "org.eclipse.birt.report.data.oda.jdbc.SPSelectDataSet" ) )
lines = new String[]{
"{call procedure-name(arg1,arg2, ...)}"
};
else
lines = new String[]{
"select", "from"
};
return lines;
}
/**
* merge paramter meta data between dataParameter and datasetDesign's
* parameter.
*
* @param dataSetDesign
* @param md
* @throws OdaException
*/
private static void mergeParameterMetaData( IParameterMetaData md ) throws OdaException
{
if ( md == null)
return;
DataSetParameters dataSetParameter = DesignSessionUtil.toDataSetParametersDesign( md,
ParameterMode.IN_LITERAL );
if ( dataSetParameter != null )
{
Iterator iter = dataSetParameter.getParameterDefinitions( )
.iterator( );
while ( iter.hasNext( ) )
{
ParameterDefinition defn = (ParameterDefinition) iter.next( );
proccessParamDefn( defn, dataSetParameter );
}
}
//dataSetDesign.setParameters( dataSetParameter );
}
/**
* Process the parameter definition for some special case
*
* @param defn
* @param parameters
*/
private static void proccessParamDefn( ParameterDefinition defn,
DataSetParameters parameters )
{
if ( defn.getAttributes( ).getNativeDataTypeCode( ) == Types.NULL )
{
defn.getAttributes( ).setNativeDataTypeCode( Types.CHAR );
}
}
/**
* Set the resultset metadata in dataset design
*
* @param dataSetDesign
* @param md
* @throws OdaException
*/
private static SQLQuery setResultSetMetaData(IResultSetMetaData md, String sqlQueryText ) throws OdaException
{
SQLQuery query=null;
ResultSetColumns columns = DesignSessionUtil.toResultSetColumnsDesign( md );
if ( columns != null )
{
query=new SQLQuery();
ResultSetDefinition resultSetDefn = DesignFactory.eINSTANCE.createResultSetDefinition( );
resultSetDefn.setResultSetColumns( columns );
int count=resultSetDefn.getResultSetColumns().getResultColumnDefinitions().size();
query.setSqlQueryString(sqlQueryText);
for (int i = 0; i < count; i++)
{
int columntype=-1;
String columname="";
try {
ResultSetMetaData dataset=(ResultSetMetaData)md;
columname=dataset.getColumnName(i+1);
columntype=dataset.getColumnType(i+1);
} catch (Exception e)
{
return null;
}
query.setFields(columname, columntype);
}
}
return query;
}
private static String addDummyWhere(String sqlQueryText)
{
if (sqlQueryText==null) {
return null;
}
String tempsql = sqlQueryText.toUpperCase();
String sql_query="";
int where_pos = tempsql.toUpperCase().indexOf("WHERE");
if (where_pos > 0)
{
sql_query = tempsql.substring(0,where_pos );
}
else
{
sql_query = tempsql;
}
return sql_query+" Where 1=2";
}
}
| BIRT-eXperts/IBM-Maximo-BIRT-Code-Generator | src/com/mmkarton/mx7/reportgenerator/sqledit/SQLUtility.java | Java | epl-1.0 | 7,663 | 26.077739 | 119 | 0.68498 | false |
package hu.eltesoft.modelexecution.m2t.smap.emf;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
/**
* Maps qualified EMF object references to virtual line numbers. Line numbering
* starts from one, and incremented by one when a new reference inserted.
*/
class ReferenceToLineMapping implements Serializable {
private static final long serialVersionUID = 303577619348585564L;
private final Vector<QualifiedReference> lineNumberToReference = new Vector<>();
private final Map<QualifiedReference, Integer> referenceToLineNumber = new HashMap<>();
public int addLineNumber(QualifiedReference reference) {
Integer result = toLineNumber(reference);
if (null != result) {
return result;
}
lineNumberToReference.add(reference);
int lineNumber = lineNumberToReference.size();
referenceToLineNumber.put(reference, lineNumber);
return lineNumber;
}
public Integer toLineNumber(QualifiedReference reference) {
return referenceToLineNumber.get(reference);
}
public QualifiedReference fromLineNumber(int lineNumber) {
// Vectors are indexed from zero, while lines from one
int index = lineNumber - 1;
if (index < 0 || lineNumberToReference.size() <= index) {
return null;
}
return lineNumberToReference.get(index);
}
@Override
public String toString() {
return referenceToLineNumber.toString() + ";" + lineNumberToReference.toString();
}
}
| ELTE-Soft/xUML-RT-Executor | plugins/hu.eltesoft.modelexecution.m2t.smap.emf/src/hu/eltesoft/modelexecution/m2t/smap/emf/ReferenceToLineMapping.java | Java | epl-1.0 | 1,442 | 27.84 | 88 | 0.76491 | false |
package pacman.carte;
import java.util.ArrayList;
import pacman.personnages.Pacman;
import pacman.personnages.Personnage;
public class Labyrinthe {
public static final int NB_COLONNE = 20;
public static final int NB_LIGNE = 20;
protected int[][] grille;
protected int largeur;
protected int hauteur;
public static int LARGEUR_CASE = 25;
public static int HAUTEUR_CASE = 25;
protected ArrayList<CaseTrappe> trappes;
protected ArrayList<CaseColle> colles;
protected Case[][] tabCases;
protected int largeurTresor;
protected int hauteurTresor;
//protected Pacman pacman;
/**
*
* @param largeur la largeur du labyrinthe
* @param hauteur la hauteur du labyrinthe
*/
public Labyrinthe(int largeur, int hauteur){
grille = new int[largeur][hauteur];
tabCases = new Case[largeur][hauteur];
this.largeur = largeur;
this.trappes = new ArrayList<CaseTrappe>();
this.hauteur = hauteur;
}
public int[][] getGrille() {
return grille;
}
public void setGrille(int[][] grille) {
this.grille = grille;
}
public void setGrilleCases(Case[][] grille){
this.tabCases = grille;
}
public int getLargeur() {
return largeur;
}
/**
* Teste si une position dans le labyrinthe est disponible, pour pouvoir s'y deplacer
* @param largeur
* @param hauteur
* @return
*/
public boolean estLibre(int largeur, int hauteur){
boolean rep = true;
/* Tests bords de map */
if(largeur < 0)
rep = false;
else if((largeur >= (this.largeur))){
rep = false;
}else if((hauteur < 0)){
rep = false;
}else if((hauteur >= (this.hauteur))){
rep = false;
}
/* Test Murs */
if(rep){
Case c = getCase(largeur, hauteur);
rep = c.isAteignable();
}
return rep;
}
public int getHauteur() {
return hauteur;
}
/**
*
* @param largeur
* @param hauteur
* @return une case du labyrinthe
*/
public Case getCase(int largeur, int hauteur){
return tabCases[largeur][hauteur];
}
public int getLargeurTabCase(){
return tabCases.length;
}
public int getHauteurTabCase(){
return tabCases[0].length;
}
public void setPosTresor(int largeur, int hauteur){
this.largeurTresor=largeur;
this.hauteurTresor=hauteur;
}
public int getLargeurTresor(){
return this.largeurTresor;
}
public int getHauteurTresor(){
return this.hauteurTresor;
}
public void addCaseTrappe(Case c){
trappes.add((CaseTrappe) c);
}
public void addCaseColle(Case c){
colles.add((CaseColle) c);
}
public CaseTrappe getDestination(Pacman p){
CaseTrappe res = null;
boolean trouv = false;
int i = 0;
while(!trouv && i < trappes.size()){
CaseTrappe c = trappes.get(i);
if(c.hit(p)){
trouv = true;
res = c.getDestination();
}
i++;
}
return res;
}
public void linkTrappes(){
for(CaseTrappe c : trappes){
makeAssociation(c);
}
}
private void makeAssociation(CaseTrappe t){
CaseTrappe res = null;
boolean trouv = false;
int i = 0;
while(!trouv && i< trappes.size()){
CaseTrappe c = trappes.get(i);
if(!c.equals(t)){//si la case en cours n'est pas celle de depart
if(c.isAssociation(t)){
t.setDestination(c);
}
}
i++;
}
}
public boolean isColle(Personnage p){
for(int i=0;i<colles.size();i++){
CaseColle c = colles.get(i);
if(c.hit(p))return true;
}
return false;
}
}
| Yoshi-xtaze/ACL2015_Jafaden | pacman/carte/Labyrinthe.java | Java | epl-1.0 | 3,356 | 18.398844 | 86 | 0.66031 | false |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = require('babel-runtime/helpers/inherits');
var _inherits3 = _interopRequireDefault(_inherits2);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _lib = require('../../lib');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A title sub-component for Accordion component
*/
var AccordionTitle = function (_Component) {
(0, _inherits3.default)(AccordionTitle, _Component);
function AccordionTitle() {
var _ref;
var _temp, _this, _ret;
(0, _classCallCheck3.default)(this, AccordionTitle);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = AccordionTitle.__proto__ || Object.getPrototypeOf(AccordionTitle)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
}
(0, _createClass3.default)(AccordionTitle, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), 'title', className);
var rest = (0, _lib.getUnhandledProps)(AccordionTitle, this.props);
var ElementType = (0, _lib.getElementType)(AccordionTitle, this.props);
return _react2.default.createElement(
ElementType,
(0, _extends3.default)({}, rest, { className: classes, onClick: this.handleClick }),
children
);
}
}]);
return AccordionTitle;
}(_react.Component);
AccordionTitle.displayName = 'AccordionTitle';
AccordionTitle._meta = {
name: 'AccordionTitle',
type: _lib.META.TYPES.MODULE,
parent: 'Accordion'
};
exports.default = AccordionTitle;
process.env.NODE_ENV !== "production" ? AccordionTitle.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Whether or not the title is in the open state. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* Called on blur.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func
} : void 0;
AccordionTitle.handledProps = ['active', 'as', 'children', 'className', 'onClick']; | jessicaappelbaum/cljs-update | node_modules/semantic-ui-react/dist/commonjs/modules/Accordion/AccordionTitle.js | JavaScript | epl-1.0 | 3,484 | 29.304348 | 240 | 0.677382 | false |
package org.jboss.windup.reporting.rules;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import org.jboss.forge.furnace.Furnace;
import org.jboss.windup.config.AbstractRuleProvider;
import org.jboss.windup.config.GraphRewrite;
import org.jboss.windup.config.metadata.RuleMetadata;
import org.jboss.windup.config.operation.GraphOperation;
import org.jboss.windup.config.phase.PostReportGenerationPhase;
import org.jboss.windup.graph.GraphContext;
import org.jboss.windup.graph.model.WindupVertexFrame;
import org.jboss.windup.graph.service.GraphService;
import org.jboss.windup.reporting.model.ApplicationReportModel;
import org.jboss.windup.reporting.model.TemplateType;
import org.jboss.windup.reporting.model.WindupVertexListModel;
import org.jboss.windup.reporting.rules.AttachApplicationReportsToIndexRuleProvider;
import org.jboss.windup.reporting.service.ApplicationReportService;
import org.ocpsoft.rewrite.config.Configuration;
import org.ocpsoft.rewrite.config.ConfigurationBuilder;
import org.ocpsoft.rewrite.context.EvaluationContext;
/**
* This renders an application index page listing all applications analyzed by the current execution of windup.
*
* @author <a href="mailto:jesse.sightler@gmail.com">Jesse Sightler</a>
*/
@RuleMetadata(phase = PostReportGenerationPhase.class, before = AttachApplicationReportsToIndexRuleProvider.class)
public class CreateApplicationListReportRuleProvider extends AbstractRuleProvider
{
public static final String APPLICATION_LIST_REPORT = "Application List";
private static final String OUTPUT_FILENAME = "../index.html";
public static final String TEMPLATE_PATH = "/reports/templates/application_list.ftl";
@Inject
private Furnace furnace;
// @formatter:off
@Override
public Configuration getConfiguration(GraphContext context)
{
return ConfigurationBuilder.begin()
.addRule()
.perform(new GraphOperation() {
@Override
public void perform(GraphRewrite event, EvaluationContext context) {
createIndexReport(event.getGraphContext());
}
});
}
// @formatter:on
private void createIndexReport(GraphContext context)
{
ApplicationReportService applicationReportService = new ApplicationReportService(context);
ApplicationReportModel report = applicationReportService.create();
report.setReportPriority(1);
report.setReportIconClass("glyphicon glyphicon-home");
report.setReportName(APPLICATION_LIST_REPORT);
report.setTemplatePath(TEMPLATE_PATH);
report.setTemplateType(TemplateType.FREEMARKER);
report.setDisplayInApplicationReportIndex(false);
report.setReportFilename(OUTPUT_FILENAME);
GraphService<WindupVertexListModel> listService = new GraphService<>(context, WindupVertexListModel.class);
WindupVertexListModel<ApplicationReportModel> applications = listService.create();
for (ApplicationReportModel applicationReportModel : applicationReportService.findAll())
{
if (applicationReportModel.isMainApplicationReport() != null && applicationReportModel.isMainApplicationReport())
applications.addItem(applicationReportModel);
}
Map<String, WindupVertexFrame> relatedData = new HashMap<>();
relatedData.put("applications", applications);
report.setRelatedResource(relatedData);
}
}
| mareknovotny/windup | reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationListReportRuleProvider.java | Java | epl-1.0 | 3,507 | 41.253012 | 125 | 0.756202 | false |
/**
*/
package fr.obeo.dsl.game.provider;
import fr.obeo.dsl.game.GameFactory;
import fr.obeo.dsl.game.GamePackage;
import fr.obeo.dsl.game.UI;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link fr.obeo.dsl.game.UI} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class UIItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UIItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addNamePropertyDescriptor(object);
addFollowPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Scene_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Scene_name_feature", "_UI_Scene_type"),
GamePackage.Literals.SCENE__NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Follow feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addFollowPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Scene_follow_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Scene_follow_feature", "_UI_Scene_type"),
GamePackage.Literals.SCENE__FOLLOW,
true,
false,
true,
null,
null,
null));
}
/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(GamePackage.Literals.UI__WIDGETS);
}
return childrenFeatures;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.
return super.getChildFeature(object, child);
}
/**
* This returns UI.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/UI"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((UI)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_UI_type") :
getString("_UI_UI_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(UI.class)) {
case GamePackage.UI__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case GamePackage.UI__WIDGETS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add
(createChildParameter
(GamePackage.Literals.UI__WIDGETS,
GameFactory.eINSTANCE.createContainer()));
newChildDescriptors.add
(createChildParameter
(GamePackage.Literals.UI__WIDGETS,
GameFactory.eINSTANCE.createText()));
newChildDescriptors.add
(createChildParameter
(GamePackage.Literals.UI__WIDGETS,
GameFactory.eINSTANCE.createButton()));
newChildDescriptors.add
(createChildParameter
(GamePackage.Literals.UI__WIDGETS,
GameFactory.eINSTANCE.createIFrame()));
newChildDescriptors.add
(createChildParameter
(GamePackage.Literals.UI__WIDGETS,
GameFactory.eINSTANCE.createHTMLElement()));
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return GameEditPlugin.INSTANCE;
}
}
| Obeo/Game-Designer | plugins/fr.obeo.dsl.game.edit/src-gen/fr/obeo/dsl/game/provider/UIItemProvider.java | Java | epl-1.0 | 6,992 | 28.012448 | 108 | 0.715246 | false |
/*******************************************************************************
* Copyright (c) 2012-2017 Codenvy, S.A.
* 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:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.datasource.ide.newDatasource.connector;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import org.eclipse.che.datasource.ide.DatasourceUiResources;
import javax.annotation.Nullable;
public class DefaultNewDatasourceConnectorViewImpl extends Composite implements DefaultNewDatasourceConnectorView {
interface NewDatasourceViewImplUiBinder extends UiBinder<Widget, DefaultNewDatasourceConnectorViewImpl> {
}
@UiField
Label configureTitleCaption;
@UiField
TextBox hostField;
@UiField
TextBox portField;
@UiField
TextBox dbName;
@UiField
TextBox usernameField;
@UiField
TextBox passwordField;
@UiField
Button testConnectionButton;
@UiField
Label testConnectionErrorMessage;
@UiField
RadioButton radioUserPref;
@UiField
RadioButton radioProject;
@UiField
ListBox projectsList;
@UiField
CheckBox useSSL;
@UiField
CheckBox verifyServerCertificate;
@UiField
DatasourceUiResources datasourceUiResources;
@UiField
Label testConnectionText;
private ActionDelegate delegate;
protected String encryptedPassword;
protected boolean passwordFieldIsDirty = false;
private Long runnerProcessId;
@Inject
public DefaultNewDatasourceConnectorViewImpl(NewDatasourceViewImplUiBinder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
hostField.setText("localhost");
radioUserPref.setValue(true);
radioProject.setEnabled(false);
projectsList.setEnabled(false);
projectsList.setWidth("100px");
configureTitleCaption.setText("Settings");
}
@Override
public void setDelegate(DefaultNewDatasourceConnectorView.ActionDelegate delegate) {
this.delegate = delegate;
}
@Override
public void setImage(@Nullable ImageResource image) {
}
@Override
public void setDatasourceName(@Nullable String dsName) {
}
@Override
public String getDatabaseName() {
return dbName.getText();
}
@UiHandler("dbName")
public void onDatabaseNameFieldChanged(KeyUpEvent event) {
delegate.databaseNameChanged(dbName.getText());
}
@Override
public String getHostname() {
return hostField.getText();
}
@UiHandler("hostField")
public void onHostNameFieldChanged(KeyUpEvent event) {
delegate.hostNameChanged(hostField.getText());
}
@Override
public int getPort() {
return Integer.parseInt(portField.getText());
}
@Override
public String getUsername() {
return usernameField.getText();
}
@UiHandler("usernameField")
public void onUserNameFieldChanged(KeyUpEvent event) {
delegate.userNameChanged(usernameField.getText());
}
@Override
public String getPassword() {
return passwordField.getText();
}
@UiHandler("passwordField")
public void onPasswordNameFieldChanged(KeyUpEvent event) {
delegate.passwordChanged(passwordField.getText());
delegate.onClickTestConnectionButton();
}
@Override
public String getEncryptedPassword() {
return encryptedPassword;
}
@Override
public void setPort(int port) {
portField.setText(Integer.toString(port));
}
@UiHandler("portField")
public void onPortFieldChanged(KeyPressEvent event) {
if (!Character.isDigit(event.getCharCode())) {
portField.cancelKey();
}
delegate.portChanged(Integer.parseInt(portField.getText()));
}
@Override
public boolean getUseSSL() {
if (useSSL.getValue() != null) {
return useSSL.getValue();
} else {
return false;
}
}
@Override
public boolean getVerifyServerCertificate() {
if (verifyServerCertificate.getValue() != null) {
return verifyServerCertificate.getValue();
} else {
return false;
}
}
@Override
public void setDatabaseName(final String databaseName) {
dbName.setValue(databaseName);
}
@Override
public void setHostName(final String hostName) {
hostField.setValue(hostName);
}
@Override
public void setUseSSL(final boolean useSSL) {
this.useSSL.setValue(useSSL);
}
@UiHandler({"useSSL"})
void onUseSSLChanged(ValueChangeEvent<Boolean> event) {
delegate.useSSLChanged(event.getValue());
}
@Override
public void setVerifyServerCertificate(final boolean verifyServerCertificate) {
this.verifyServerCertificate.setValue(verifyServerCertificate);
}
@UiHandler({"verifyServerCertificate"})
void onVerifyServerCertificateChanged(ValueChangeEvent<Boolean> event) {
delegate.verifyServerCertificateChanged(event.getValue());
}
@Override
public void setUsername(final String username) {
usernameField.setValue(username);
}
@Override
public void setPassword(final String password) {
passwordField.setValue(password);
}
@UiHandler("testConnectionButton")
void handleClick(ClickEvent e) {
delegate.onClickTestConnectionButton();
}
@UiHandler("testConnectionText")
void handleTextClick(ClickEvent e) {
delegate.onClickTestConnectionButton();
}
@Override
public void onTestConnectionSuccess() {
// turn button green
testConnectionButton.setStyleName(datasourceUiResources.datasourceUiCSS().datasourceWizardTestConnectionOK());
// clear error messages
testConnectionErrorMessage.setText("Connection Established Successfully!");
}
@Override
public void onTestConnectionFailure(String errorMessage) {
// turn test button red
testConnectionButton.setStyleName(datasourceUiResources.datasourceUiCSS().datasourceWizardTestConnectionKO());
// set message
testConnectionErrorMessage.setText(errorMessage);
}
@Override
public void setEncryptedPassword(String encryptedPassword, boolean resetPasswordField) {
this.encryptedPassword = encryptedPassword;
passwordFieldIsDirty = false;
if (resetPasswordField) {
passwordField.setText("");
}
}
@UiHandler("passwordField")
public void handlePasswordFieldChanges(ChangeEvent event) {
passwordFieldIsDirty = true;
}
@Override
public boolean isPasswordFieldDirty() {
return passwordFieldIsDirty;
}
@Override
public Long getRunnerProcessId() {
return runnerProcessId;
}
@Override
public void setRunnerProcessId(Long runnerProcessId) {
this.runnerProcessId = runnerProcessId;
}
}
| sudaraka94/che | wsagent/che-datasource-ide/src/main/java/org/eclipse/che/datasource/ide/newDatasource/connector/DefaultNewDatasourceConnectorViewImpl.java | Java | epl-1.0 | 8,136 | 25.588235 | 118 | 0.686087 | false |
/*************************************************************************
*** FORTE Library Element
***
*** This file was generated using the 4DIAC FORTE Export Filter V1.0.x!
***
*** Name: F_TIME_TO_USINT
*** Description: convert TIME to USINT
*** Version:
*** 0.0: 2013-08-29/4DIAC-IDE - 4DIAC-Consortium - null
*************************************************************************/
#include "F_TIME_TO_USINT.h"
#ifdef FORTE_ENABLE_GENERATED_SOURCE_CPP
#include "F_TIME_TO_USINT_gen.cpp"
#endif
DEFINE_FIRMWARE_FB(FORTE_F_TIME_TO_USINT, g_nStringIdF_TIME_TO_USINT)
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anDataInputNames[] = {g_nStringIdIN};
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anDataInputTypeIds[] = {g_nStringIdTIME};
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anDataOutputNames[] = {g_nStringIdOUT};
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anDataOutputTypeIds[] = {g_nStringIdUSINT};
const TForteInt16 FORTE_F_TIME_TO_USINT::scm_anEIWithIndexes[] = {0};
const TDataIOID FORTE_F_TIME_TO_USINT::scm_anEIWith[] = {0, 255};
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anEventInputNames[] = {g_nStringIdREQ};
const TDataIOID FORTE_F_TIME_TO_USINT::scm_anEOWith[] = {0, 255};
const TForteInt16 FORTE_F_TIME_TO_USINT::scm_anEOWithIndexes[] = {0, -1};
const CStringDictionary::TStringId FORTE_F_TIME_TO_USINT::scm_anEventOutputNames[] = {g_nStringIdCNF};
const SFBInterfaceSpec FORTE_F_TIME_TO_USINT::scm_stFBInterfaceSpec = {
1, scm_anEventInputNames, scm_anEIWith, scm_anEIWithIndexes,
1, scm_anEventOutputNames, scm_anEOWith, scm_anEOWithIndexes, 1, scm_anDataInputNames, scm_anDataInputTypeIds,
1, scm_anDataOutputNames, scm_anDataOutputTypeIds,
0, 0
};
void FORTE_F_TIME_TO_USINT::executeEvent(int pa_nEIID){
if(scm_nEventREQID == pa_nEIID){
OUT() = TIME_TO_USINT(IN());
sendOutputEvent(scm_nEventCNFID);
}
}
| EstebanQuerol/Black_FORTE | src/modules/IEC61131-3/Conversion/TIME/F_TIME_TO_USINT.cpp | C++ | epl-1.0 | 2,013 | 40.1875 | 116 | 0.668157 | false |
/**
*/
package org.eclipse.xtext.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.xtext.UntilToken;
import org.eclipse.xtext.XtextPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Until Token</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class UntilTokenImpl extends AbstractNegatedTokenImpl implements UntilToken {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UntilTokenImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.UNTIL_TOKEN;
}
} //UntilTokenImpl
| miklossy/xtext-core | org.eclipse.xtext/emf-gen/org/eclipse/xtext/impl/UntilTokenImpl.java | Java | epl-1.0 | 706 | 18.081081 | 84 | 0.637394 | false |
/*
* generated by Xtext
*/
package org.eclipse.xtext.testlanguages.fileAware.scoping;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.testlanguages.fileAware.fileAware.FileAwarePackage;
import com.google.inject.Inject;
/**
* This class contains custom scoping description.
*
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
* on how and when to use it.
*/
public class FileAwareTestLanguageScopeProvider extends AbstractFileAwareTestLanguageScopeProvider {
@Inject IGlobalScopeProvider global;
public IScope getScope(EObject context, EReference reference) {
if (reference == FileAwarePackage.Literals.IMPORT__ELEMENT) {
return global.getScope(context.eResource(), reference, null);
}
return super.getScope(context, reference);
}
}
| miklossy/xtext-core | org.eclipse.xtext.testlanguages/src/org/eclipse/xtext/testlanguages/fileAware/scoping/FileAwareTestLanguageScopeProvider.java | Java | epl-1.0 | 944 | 29.451613 | 100 | 0.792373 | false |
/*******************************************************************************
* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
******************************************************************************/
package org.eclipse.persistence.testing.oxm.readonly;
import org.eclipse.persistence.sessions.Project;
import org.eclipse.persistence.oxm.*;
import org.eclipse.persistence.oxm.mappings.XMLDirectMapping;
public class OneDirectMappingProject extends Project
{
public OneDirectMappingProject()
{
super();
addEmployeeDescriptor();
}
public void addEmployeeDescriptor()
{
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setDefaultRootElement("employee");
descriptor.setJavaClass(Employee.class);
XMLDirectMapping firstNameMapping = new XMLDirectMapping();
firstNameMapping.setAttributeName("firstName");
firstNameMapping.setXPath("first-name/text()");
firstNameMapping.readOnly();
descriptor.addMapping(firstNameMapping);
this.addDescriptor(descriptor);
}
}
| bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/readonly/OneDirectMappingProject.java | Java | epl-1.0 | 1,579 | 35.595238 | 87 | 0.675111 | false |
# Map Transformation Service
Transforms the input by mapping it to another string. It expects the mappings to be read from a file which is stored under the `transform` folder.
The file name must have the `.map` extension.
This file should be in property syntax, i.e. simple lines with "key=value" pairs.
The file format is documented [here](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-).
To organize the various transformations one might use subfolders.
A default value can be provided if no matching entry is found by using "=value" syntax
## Example
transform/binary.map:
```properties
key=value
1=ON
0=OFF
ON=1
OFF=0
white\ space=showing escape
=default
```
| input | output |
|---------------|----------------|
| `1` | `ON` |
| `OFF` | `0` |
| `key` | `value` |
| `white space` | `using escape` |
| `anything` | `default` |
## Usage as a Profile
The functionality of this `TransformationService` can be used in a `Profile` on an `ItemChannelLink` too.
To do so, it can be configured in the `.items` file as follows:
```java
String <itemName> { channel="<channelUID>"[profile="transform:MAP", function="<filename>", sourceFormat="<valueFormat>"]}
```
The mapping filename (within the `transform` folder) has to be set in the `function` parameter.
The parameter `sourceFormat` is optional and can be used to format the input value **before** the transformation, i.e. `%.3f`.
If omitted the default is `%s`, so the input value will be put into the transformation without any format changes.
Please note: This profile is a one-way transformation, i.e. only values from a device towards the item are changed, the other direction is left untouched.
| paulianttila/openhab2 | bundles/org.openhab.transform.map/README.md | Markdown | epl-1.0 | 1,783 | 36.93617 | 154 | 0.688727 | false |
package com.odcgroup.page.transformmodel.ui.builder;
import org.eclipse.core.runtime.Assert;
import com.odcgroup.mdf.ecore.util.DomainRepository;
import com.odcgroup.page.metamodel.MetaModel;
import com.odcgroup.page.metamodel.util.MetaModelRegistry;
import com.odcgroup.page.model.corporate.CorporateDesign;
import com.odcgroup.page.model.corporate.CorporateDesignUtils;
import com.odcgroup.page.model.util.WidgetFactory;
import com.odcgroup.workbench.core.IOfsProject;
/**
* The WidgetBuilderContext is used to provide information to all the different
* WidgetBuilder's used when building a Widget.
*
* @author Gary Hayes
*/
public class WidgetBuilderContext {
/** The OFS project for which we are building Widgets. */
private IOfsProject ofsProject;
/** This is the corporate design to use when building template. */
private CorporateDesign corporateDesign;
/** The WidgetBuilderFactory used to build Widgets. */
private WidgetBuilderFactory widgetBuilderFactory;
/**
* Creates a new WidgetBuilderContext.
*
* @param ofsProject The OFS project for which we are building Widgets
* @param widgetBuilderFactory The WidgetBuilderFactory used to build Widgets
*/
public WidgetBuilderContext(IOfsProject ofsProject, WidgetBuilderFactory widgetBuilderFactory) {
Assert.isNotNull(ofsProject);
Assert.isNotNull(widgetBuilderFactory);
this.ofsProject = ofsProject;
this.widgetBuilderFactory = widgetBuilderFactory;
corporateDesign = CorporateDesignUtils.getCorporateDesign(ofsProject);
}
/**
* Gets the path containing the model definitions.
*
* @return path
*/
public final DomainRepository getDomainRepository() {
return DomainRepository.getInstance(ofsProject);
}
/**
* Gets the Corporate Design.
*
* @return CorporateDesign The corporate design attached to this builder
*/
public final CorporateDesign getCorporateDesign() {
return corporateDesign;
}
/**
* Gets the metamodel.
*
* @return MetaModel The metamodel.
*/
public final MetaModel getMetaModel() {
return MetaModelRegistry.getMetaModel();
}
/**
* Gets the project for which we are building Widgets.
*
* @return IProject
*/
public final IOfsProject getOfsProject() {
return ofsProject;
}
/**
* Gets the Factory used to build Widgets.
*
* @return WidgetBuilderFactory
*/
public final WidgetBuilderFactory getBuilderFactory() {
return widgetBuilderFactory;
}
/**
* Gets the WidgetFactory.
*
* @return WidgetFactory The WidgetFactory
*/
public WidgetFactory getWidgetFactory() {
return new WidgetFactory();
}
} | debabratahazra/DS | designstudio/components/page/ui/com.odcgroup.page.transformmodel.ui/src/main/java/com/odcgroup/page/transformmodel/ui/builder/WidgetBuilderContext.java | Java | epl-1.0 | 2,613 | 25.14 | 97 | 0.754688 | false |
/*******************************************************************************
* Copyright 2009 Regents of the University of Minnesota. All rights
* reserved.
* Copyright 2009 Mayo Foundation for Medical Education and Research.
* All rights reserved.
*
* This program is 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
* IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
* OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
* PARTICULAR PURPOSE. See the License for the specific language
* governing permissions and limitations under the License.
*
* Contributors:
* Minnesota Supercomputing Institute - initial API and implementation
******************************************************************************/
package edu.umn.msi.tropix.storage.client.impl;
import java.util.HashMap;
import java.util.Map;
import org.easymock.EasyMock;
import org.testng.annotations.Test;
import edu.umn.msi.tropix.common.test.EasyMockUtils;
import edu.umn.msi.tropix.grid.credentials.Credential;
import edu.umn.msi.tropix.models.TropixFile;
import edu.umn.msi.tropix.storage.client.ModelStorageData;
public class ModelStorageDataFactoryImplTest {
@Test(groups = "unit")
public void get() {
final ModelStorageDataFactoryImpl factory = new ModelStorageDataFactoryImpl();
final TropixFileFactory tfFactory = EasyMock.createMock(TropixFileFactory.class);
factory.setTropixFileFactory(tfFactory);
final Credential proxy = EasyMock.createMock(Credential.class);
TropixFile tropixFile = new TropixFile();
ModelStorageData mds = EasyMock.createMock(ModelStorageData.class);
final String serviceUrl = "http://storage";
final Map<String, Object> map = new HashMap<String, Object>();
map.put("storageServiceUrl", serviceUrl);
tfFactory.getStorageData(EasyMockUtils.<TropixFile>isBeanWithProperties(map), EasyMock.same(proxy));
EasyMock.expectLastCall().andReturn(mds);
EasyMock.replay(tfFactory);
assert mds == factory.getStorageData(serviceUrl, proxy);
EasyMockUtils.verifyAndReset(tfFactory);
tropixFile = new TropixFile();
mds = EasyMock.createMock(ModelStorageData.class);
map.put("fileId", "12345");
tfFactory.getStorageData(EasyMockUtils.<TropixFile>isBeanWithProperties(map), EasyMock.same(proxy));
EasyMock.expectLastCall().andReturn(mds);
EasyMock.replay(tfFactory);
assert mds == factory.getStorageData("12345", serviceUrl, proxy);
EasyMockUtils.verifyAndReset(tfFactory);
tropixFile = new TropixFile();
mds = EasyMock.createMock(ModelStorageData.class);
tfFactory.getStorageData(EasyMock.same(tropixFile), EasyMock.same(proxy));
EasyMock.expectLastCall().andReturn(mds);
EasyMock.replay(tfFactory);
assert mds == factory.getStorageData(tropixFile, proxy);
EasyMockUtils.verifyAndReset(tfFactory);
}
}
| jmchilton/TINT | projects/TropixStorageClient/src/test/edu/umn/msi/tropix/storage/client/impl/ModelStorageDataFactoryImplTest.java | Java | epl-1.0 | 3,201 | 41.68 | 104 | 0.728835 | false |
/*******************************************************************************
* Copyright (c) 2005, 2009 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.dtd.ui.internal.wizard;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.text.templates.DocumentTemplateContext;
import org.eclipse.jface.text.templates.Template;
import org.eclipse.jface.text.templates.TemplateBuffer;
import org.eclipse.jface.text.templates.TemplateContext;
import org.eclipse.jface.text.templates.TemplateContextType;
import org.eclipse.jface.text.templates.persistence.TemplateStore;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
import org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
import org.eclipse.wst.dtd.ui.internal.Logger;
import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
import org.eclipse.wst.dtd.ui.internal.preferences.DTDUIPreferenceNames;
import org.eclipse.wst.dtd.ui.internal.templates.TemplateContextTypeIdsDTD;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
/**
* Templates page in new file wizard. Allows users to select a new file
* template to be applied in new file.
*
*/
public class NewDTDTemplatesWizardPage extends WizardPage {
/**
* Content provider for templates
*/
private class TemplateContentProvider implements IStructuredContentProvider {
/** The template store. */
private TemplateStore fStore;
/*
* @see IContentProvider#dispose()
*/
public void dispose() {
fStore = null;
}
/*
* @see IStructuredContentProvider#getElements(Object)
*/
public Object[] getElements(Object input) {
return fStore.getTemplates(TemplateContextTypeIdsDTD.NEW);
}
/*
* @see IContentProvider#inputChanged(Viewer, Object, Object)
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
fStore = (TemplateStore) newInput;
}
}
/**
* Label provider for templates.
*/
private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
/*
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
* int)
*/
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
/*
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
* int)
*/
public String getColumnText(Object element, int columnIndex) {
Template template = (Template) element;
switch (columnIndex) {
case 0 :
return template.getName();
case 1 :
return template.getDescription();
default :
return ""; //$NON-NLS-1$
}
}
}
/** Last selected template name */
private String fLastSelectedTemplateName;
/** The viewer displays the pattern of selected template. */
private SourceViewer fPatternViewer;
/** The table presenting the templates. */
private TableViewer fTableViewer;
/** Template store used by this wizard page */
private TemplateStore fTemplateStore;
/** Checkbox for using templates. */
private Button fUseTemplateButton;
public NewDTDTemplatesWizardPage() {
super("NewDTDTemplatesWizardPage", DTDUIMessages.NewDTDTemplatesWizardPage_0, null); //$NON-NLS-1$
setDescription(DTDUIMessages.NewDTDTemplatesWizardPage_1);
}
/**
* Correctly resizes the table so no phantom columns appear
*
* @param parent
* the parent control
* @param buttons
* the buttons
* @param table
* the table
* @param column1
* the first column
* @param column2
* the second column
* @param column3
* the third column
*/
private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
parent.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle area = parent.getClientArea();
Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column
// width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
Point oldSize = table.getSize();
if (oldSize.x > width) {
// table is getting smaller so make the columns
// smaller first and then resize the table to
// match the client area width
column1.setWidth(width / 2);
column2.setWidth(width / 2);
table.setSize(width, area.height);
}
else {
// table is getting bigger so make the table
// bigger first and then make the columns wider
// to match the client area width
table.setSize(width, area.height);
column1.setWidth(width / 2);
column2.setWidth(width / 2);
}
}
});
}
public void createControl(Composite ancestor) {
Composite parent = new Composite(ancestor, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
parent.setLayout(layout);
// create checkbox for user to use DTD Template
fUseTemplateButton = new Button(parent, SWT.CHECK);
fUseTemplateButton.setText(DTDUIMessages.NewDTDTemplatesWizardPage_4);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
fUseTemplateButton.setLayoutData(data);
fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
enableTemplates();
}
});
// create composite for Templates table
Composite innerParent = new Composite(parent, SWT.NONE);
GridLayout innerLayout = new GridLayout();
innerLayout.numColumns = 2;
innerLayout.marginHeight = 0;
innerLayout.marginWidth = 0;
innerParent.setLayout(innerLayout);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
innerParent.setLayoutData(gd);
Label label = new Label(innerParent, SWT.NONE);
label.setText(DTDUIMessages.NewDTDTemplatesWizardPage_7);
data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
label.setLayoutData(data);
// create table that displays templates
Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
data = new GridData(GridData.FILL_BOTH);
data.widthHint = convertWidthInCharsToPixels(2);
data.heightHint = convertHeightInCharsToPixels(10);
data.horizontalSpan = 2;
table.setLayoutData(data);
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText(DTDUIMessages.NewDTDTemplatesWizardPage_2);
TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText(DTDUIMessages.NewDTDTemplatesWizardPage_3);
fTableViewer = new TableViewer(table);
fTableViewer.setLabelProvider(new TemplateLabelProvider());
fTableViewer.setContentProvider(new TemplateContentProvider());
fTableViewer.setSorter(new ViewerSorter() {
public int compare(Viewer viewer, Object object1, Object object2) {
if ((object1 instanceof Template) && (object2 instanceof Template)) {
Template left = (Template) object1;
Template right = (Template) object2;
int result = left.getName().compareToIgnoreCase(right.getName());
if (result != 0)
return result;
return left.getDescription().compareToIgnoreCase(right.getDescription());
}
return super.compare(viewer, object1, object2);
}
public boolean isSorterProperty(Object element, String property) {
return true;
}
});
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
updateViewerInput();
}
});
// create viewer that displays currently selected template's contents
fPatternViewer = doCreateViewer(parent);
fTemplateStore = DTDUIPlugin.getDefault().getTemplateStore();
fTableViewer.setInput(fTemplateStore);
// Create linked text to just to templates preference page
Link link = new Link(parent, SWT.NONE);
link.setText(DTDUIMessages.NewDTDTemplatesWizardPage_6);
data = new GridData(SWT.END, SWT.FILL, true, false, 2, 1);
link.setLayoutData(data);
link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
linkClicked();
}
});
configureTableResizing(innerParent, table, column1, column2);
loadLastSavedPreferences();
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.DTD_NEWWIZARD_TEMPLATE_HELPID);
Dialog.applyDialogFont(parent);
setControl(parent);
}
/**
* Creates, configures and returns a source viewer to present the template
* pattern on the preference page. Clients may override to provide a
* custom source viewer featuring e.g. syntax coloring.
*
* @param parent
* the parent control
* @return a configured source viewer
*/
private SourceViewer createViewer(Composite parent) {
SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationDTD();
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return baseConfiguration.getConfiguredContentTypes(sourceViewer);
}
public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
}
};
SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
viewer.getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForDTD.ContentTypeID_DTD);
IDocument document = scratchModel.getStructuredDocument();
viewer.configure(sourceViewerConfiguration);
viewer.setDocument(document);
return viewer;
}
private SourceViewer doCreateViewer(Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(DTDUIMessages.NewDTDTemplatesWizardPage_5);
GridData data = new GridData();
data.horizontalSpan = 2;
label.setLayoutData(data);
SourceViewer viewer = createViewer(parent);
viewer.setEditable(false);
Control control = viewer.getControl();
data = new GridData(GridData.FILL_BOTH);
data.horizontalSpan = 2;
data.heightHint = convertHeightInCharsToPixels(5);
// [261274] - source viewer was growing to fit the max line width of the template
data.widthHint = convertWidthInCharsToPixels(2);
control.setLayoutData(data);
return viewer;
}
/**
* Enable/disable controls in page based on fUseTemplateButton's current
* state.
*/
void enableTemplates() {
boolean enabled = fUseTemplateButton.getSelection();
if (!enabled) {
// save last selected template
Template template = getSelectedTemplate();
if (template != null)
fLastSelectedTemplateName = template.getName();
else
fLastSelectedTemplateName = ""; //$NON-NLS-1$
fTableViewer.setSelection(null);
}
else {
setSelectedTemplate(fLastSelectedTemplateName);
}
fTableViewer.getControl().setEnabled(enabled);
fPatternViewer.getControl().setEnabled(enabled);
}
/**
* Return the template preference page id
*
* @return
*/
private String getPreferencePageId() {
return "org.eclipse.wst.sse.ui.preferences.dtd.templates"; //$NON-NLS-1$
}
/**
* Get the currently selected template.
*
* @return
*/
private Template getSelectedTemplate() {
Template template = null;
IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
if (selection.size() == 1) {
template = (Template) selection.getFirstElement();
}
return template;
}
/**
* Returns template string to insert.
*
* @return String to insert or null if none is to be inserted
*/
String getTemplateString() {
String templateString = null;
Template template = getSelectedTemplate();
if (template != null) {
TemplateContextType contextType = DTDUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsDTD.NEW);
IDocument document = new Document();
TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
try {
TemplateBuffer buffer = context.evaluate(template);
templateString = buffer.getString();
}
catch (Exception e) {
Logger.log(Logger.WARNING_DEBUG, "Could not create template for new dtd", e); //$NON-NLS-1$
}
}
return templateString;
}
void linkClicked() {
String pageId = getPreferencePageId();
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
dialog.open();
fTableViewer.refresh();
}
/**
* Load the last template name used in New DTD File wizard.
*/
private void loadLastSavedPreferences() {
String templateName = DTDUIPlugin.getDefault().getPreferenceStore().getString(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
if (templateName == null || templateName.length() == 0) {
fLastSelectedTemplateName = ""; //$NON-NLS-1$
fUseTemplateButton.setSelection(false);
}
else {
fLastSelectedTemplateName = templateName;
fUseTemplateButton.setSelection(true);
}
enableTemplates();
}
/**
* Save template name used for next call to New DTD File wizard.
*/
void saveLastSavedPreferences() {
String templateName = ""; //$NON-NLS-1$
Template template = getSelectedTemplate();
if (template != null) {
templateName = template.getName();
}
DTDUIPlugin.getDefault().getPreferenceStore().setValue(DTDUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
DTDUIPlugin.getDefault().savePluginPreferences();
}
/**
* Select a template in the table viewer given the template name. If
* template name cannot be found or templateName is null, just select
* first item in table. If no items in table select nothing.
*
* @param templateName
*/
private void setSelectedTemplate(String templateName) {
Object template = null;
if (templateName != null && templateName.length() > 0) {
// pick the last used template
template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsDTD.NEW);
}
// no record of last used template so just pick first element
if (template == null) {
// just pick first element
template = fTableViewer.getElementAt(0);
}
if (template != null) {
IStructuredSelection selection = new StructuredSelection(template);
fTableViewer.setSelection(selection, true);
}
}
/**
* Updates the pattern viewer.
*/
void updateViewerInput() {
Template template = getSelectedTemplate();
if (template != null) {
fPatternViewer.getDocument().set(template.getPattern());
}
else {
fPatternViewer.getDocument().set(""); //$NON-NLS-1$
}
}
}
| ttimbul/eclipse.wst | bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/wizard/NewDTDTemplatesWizardPage.java | Java | epl-1.0 | 17,558 | 33.226121 | 148 | 0.73915 | false |
#include "pMidiToFrequency.h"
#include "../pObjectList.hpp"
#include "../../dsp/math.hpp"
using namespace YSE::PATCHER;
#define className pMidiToFrequency
CONSTRUCT() {
midiValue = 0.f;
ADD_IN_0;
REG_FLOAT_IN(SetMidi);
REG_INT_IN(SetMidiInt);
ADD_OUT_FLOAT;
}
FLOAT_IN(SetMidi) {
midiValue = value;
}
INT_IN(SetMidiInt) {
midiValue = (float)value;
}
CALC() {
outputs[0].SendFloat(YSE::DSP::MidiToFreq(midiValue), thread);
}
| yvanvds/yse-soundengine | YseEngine/patcher/math/pMidiToFrequency.cpp | C++ | epl-1.0 | 454 | 13.645161 | 64 | 0.667401 | false |
/*******************************************************************************
* Copyright (c) 2021 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 com.ibm.ws.jpa.fvt.entity.tests.web;
import java.util.HashMap;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;
import javax.servlet.annotation.WebServlet;
import org.junit.Test;
import com.ibm.ws.jpa.fvt.entity.testlogic.EmbeddableIDTestLogic;
import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext;
import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext.PersistenceContextType;
import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext.PersistenceInjectionType;
import com.ibm.ws.testtooling.vehicle.web.JPATestServlet;
@SuppressWarnings("serial")
@WebServlet(urlPatterns = "/EmbeddableIDTestServlet")
public class EmbeddableIDTestServlet extends JPATestServlet {
// Container Managed Transaction Scope
@PersistenceContext(unitName = "ENTITY_JTA")
private EntityManager cmtsEm;
// Application Managed JTA
@PersistenceUnit(unitName = "ENTITY_JTA")
private EntityManagerFactory amjtaEmf;
// Application Managed Resource-Local
@PersistenceUnit(unitName = "ENTITY_RL")
private EntityManagerFactory amrlEmf;
@PostConstruct
private void initFAT() {
testClassName = EmbeddableIDTestLogic.class.getName();
jpaPctxMap.put("test-jpa-resource-amjta",
new JPAPersistenceContext("test-jpa-resource-amjta", PersistenceContextType.APPLICATION_MANAGED_JTA, PersistenceInjectionType.FIELD, "amjtaEmf"));
jpaPctxMap.put("test-jpa-resource-amrl",
new JPAPersistenceContext("test-jpa-resource-amrl", PersistenceContextType.APPLICATION_MANAGED_RL, PersistenceInjectionType.FIELD, "amrlEmf"));
jpaPctxMap.put("test-jpa-resource-cmts",
new JPAPersistenceContext("test-jpa-resource-cmts", PersistenceContextType.CONTAINER_MANAGED_TS, PersistenceInjectionType.FIELD, "cmtsEm"));
}
@Test
public void jpa10_Entity_EmbeddableID_Ano_AMJTA_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_Ano_AMJTA_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-amjta";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "EmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
@Test
public void jpa10_Entity_EmbeddableID_XML_AMJTA_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_XML_AMJTA_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-amjta";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "XMLEmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
@Test
public void jpa10_Entity_EmbeddableID_Ano_AMRL_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_Ano_AMRL_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-amrl";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "EmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
@Test
public void jpa10_Entity_EmbeddableID_XML_AMRL_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_XML_AMRL_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-amrl";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "XMLEmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
@Test
public void jpa10_Entity_EmbeddableID_Ano_CMTS_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_Ano_CMTS_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-cmts";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "EmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
@Test
public void jpa10_Entity_EmbeddableID_XML_CMTS_Web() throws Exception {
final String testName = "jpa10_Entity_EmbeddableID_XML_CMTS_Web";
final String testMethod = "testEmbeddableIDClass001";
final String testResource = "test-jpa-resource-cmts";
HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>();
properties.put("EntityName", "XMLEmbeddableIdEntity");
executeTest(testName, testMethod, testResource, properties);
}
}
| OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.tests.spec10.entity_fat.common/test-applications/entity/src/com/ibm/ws/jpa/fvt/entity/tests/web/EmbeddableIDTestServlet.java | Java | epl-1.0 | 5,713 | 42.946154 | 169 | 0.709435 | false |
package net.eldiosantos.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
@Entity
public class Departamento implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String nome;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
| Eldius/projeto-testes | src/main/java/net/eldiosantos/model/Departamento.java | Java | epl-1.0 | 623 | 18.46875 | 55 | 0.675762 | false |
var config = {
width: 800,
height: 600,
type: Phaser.AUTO,
parent: 'phaser-example',
scene: {
create: create,
update: update
}
};
var game = new Phaser.Game(config);
var graphics;
var pointerRect;
var rectangles;
function create ()
{
graphics = this.add.graphics({ lineStyle: { color: 0x0000aa }, fillStyle: { color: 0x0000aa, alpha: 0.5 } });
pointerRect = new Phaser.Geom.Rectangle(0, 0, 80, 60);
rectangles = [];
for(var x = 0; x < 10; x++)
{
rectangles[x] = [];
for(var y = 0; y < 10; y++)
{
rectangles[x][y] = new Phaser.Geom.Rectangle(x * 80, y * 60, 80, 60);
}
}
this.input.on('pointermove', function (pointer) {
var x = Math.floor(pointer.x / 80);
var y = Math.floor(pointer.y / 60);
pointerRect.setPosition(x * 80, y * 60);
Phaser.Geom.Rectangle.CopyFrom(pointerRect, rectangles[x][y]);
});
}
function update ()
{
graphics.clear();
graphics.fillRectShape(pointerRect);
for(var x = 0; x < 10; x++)
{
for(var y = 0; y < 10; y++)
{
var rect = rectangles[x][y];
if(rect.width > 10)
{
rect.width *= 0.95;
rect.height *= 0.95;
}
graphics.strokeRectShape(rect);
}
}
} | boniatillo-com/PhaserEditor | source/v2/phasereditor/phasereditor.resources.phaser.examples/phaser3-examples/public/src/geom/rectangle/copy from.js | JavaScript | epl-1.0 | 1,367 | 19.727273 | 113 | 0.509144 | false |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.07.08 at 01:02:29 PM CEST
//
@XmlSchema(namespace = "http://uri.etsi.org/m2m",
xmlns = { @XmlNs(namespaceURI = "http://uri.etsi.org/m2m", prefix = "om2m")},
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.eclipse.om2m.commons.resource;
import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlSchema;
| BeliliFahem/om2m-java-client-api | src/main/java/org/eclipse/om2m/commons/resource/package-info.java | Java | epl-1.0 | 667 | 49.307692 | 108 | 0.733133 | false |
/*
*******************************************************************************
* Copyright (c) 2013 Whizzo Software, LLC.
* 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
*******************************************************************************
*/
package com.whizzosoftware.wzwave.node.generic;
import com.whizzosoftware.wzwave.commandclass.BasicCommandClass;
import com.whizzosoftware.wzwave.commandclass.CommandClass;
import com.whizzosoftware.wzwave.commandclass.MultilevelSensorCommandClass;
import com.whizzosoftware.wzwave.node.NodeInfo;
import com.whizzosoftware.wzwave.node.NodeListener;
import com.whizzosoftware.wzwave.node.ZWaveNode;
import com.whizzosoftware.wzwave.persist.PersistenceContext;
/**
* A Multilevel Sensor node.
*
* @author Dan Noguerol
*/
public class MultilevelSensor extends ZWaveNode {
public static final byte ID = 0x21;
public MultilevelSensor(NodeInfo info, boolean listening, NodeListener listener) {
super(info, listening, listener);
addCommandClass(BasicCommandClass.ID, new BasicCommandClass());
addCommandClass(MultilevelSensorCommandClass.ID, new MultilevelSensorCommandClass());
}
public MultilevelSensor(PersistenceContext pctx, Byte nodeId, NodeListener listener) {
super(pctx, nodeId, listener);
}
protected CommandClass performBasicCommandClassMapping(BasicCommandClass cc) {
// Basic commands should get mapped to MultilevelSensor commands
return getCommandClass(MultilevelSensorCommandClass.ID);
}
@Override
protected void refresh(boolean deferIfNotListening) {
}
}
| whizzosoftware/WZWave | src/main/java/com/whizzosoftware/wzwave/node/generic/MultilevelSensor.java | Java | epl-1.0 | 1,822 | 37.765957 | 93 | 0.706367 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="cxxClass" />
<meta name="DC.Title" content="CSatelliteInfoUI" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA" />
<title>
CSatelliteInfoUI
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api" />
<link rel="stylesheet" type="text/css" href="cxxref.css" />
</head>
<body class="cxxref" id="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA">
<a name="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2518338 id2518347 id2420140 id2374166 id2362038 id2362043 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
</div>
<h1 class="topictitle1">
CSatelliteInfoUI Class Reference
</h1>
<table class="signature">
<tr>
<td>
class CSatelliteInfoUI : public CBase
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Implements entry point class to Satellite Info UI
</p>
</div>
</div>
<div class="section derivation">
<h2 class="sectiontitle">
Inherits from
</h2>
<ul class="derivation derivation-root">
<li class="derivation-depth-0 ">
CSatelliteInfoUI
<ul class="derivation">
<li class="derivation-depth-1 ">
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase
</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="section member-index">
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Member Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="code">
</td>
<td>
<a href="#GUID-93A99578-A735-3F5A-A355-73E54FC03D4D">
~CSatelliteInfoUI
</a>
()
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
IMPORT_C
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-0952B6DA-56C1-3D73-881F-13B0B61189BC">
ExecuteLD
</a>
(const
<a href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.html">
TDesC
</a>
&)
</td>
</tr>
<tr>
<td align="right" class="code">
IMPORT_C void
</td>
<td>
<a href="#GUID-701C4261-F095-3690-9E66-6866C00EF918">
HandleForegroundEventL
</a>
(
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
)
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
IMPORT_C
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html">
CSatelliteInfoUI
</a>
*
</td>
<td>
<a href="#GUID-B2D49139-004F-3CDA-8D1C-C44C6E16BDA1">
NewL
</a>
()
</td>
</tr>
<tr>
<td align="right" class="code">
IMPORT_C void
</td>
<td>
<a href="#GUID-1FABF8E8-FFE9-373B-90A4-ABE7A2290B1B">
SetLaunchView
</a>
(
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html">
TSatelliteView
</a>
)
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Private Member Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="code">
</td>
<td>
<a href="#GUID-670D1DFA-9DBF-32A7-BDEB-E165D7336286">
CSatelliteInfoUI
</a>
()
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
void
</td>
<td>
<a href="#GUID-4E54AE35-8E26-3D97-B67E-1270F69CF2B8">
ConstructL
</a>
()
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Inherited Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::CBase()
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::Delete(CBase *)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::Extension_(TUint,TAny *&,TAny *)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TAny *)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TLeave)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TLeave,TUint)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TUint)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::~CBase()
</a>
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Member Enumerations
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" valign="top">
enum
</td>
<td>
<a href="#GUID-CB34AEA2-3200-36E2-B794-9A637EF844E7">
TSatelliteView
</a>
{
<a href="#GUID-F6D6E7B8-5DEA-3D20-8D05-C41D3E2C32F3">
ESatelliteFirmamentView
</a>
= 0x0001,
<a href="#GUID-48850147-3943-3AD1-AE32-2D916E4118CE">
ESatelliteSignalStrengthView
</a>
= 0x0002,
<a href="#GUID-34BF2F16-AD94-3E9D-AF6E-F50156411C5A">
ESatelliteCompassView
</a>
= 0x0003 }
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Private Attributes
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
*
</td>
<td>
<a href="#GUID-D5ECE435-475B-37E7-A6D8-2C499F65937F">
iDestroyedPtr
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
CSatellite *
</td>
<td>
<a href="#GUID-8912768F-47F8-31B9-90EF-CD3681D43EA9">
iSatellite
</a>
</td>
</tr>
</tbody>
</table>
</div>
<h1 class="pageHeading topictitle1">
Constructor & Destructor Documentation
</h1>
<div class="nested1" id="GUID-670D1DFA-9DBF-32A7-BDEB-E165D7336286">
<a name="GUID-670D1DFA-9DBF-32A7-BDEB-E165D7336286">
<!-- -->
</a>
<h2 class="topictitle2">
CSatelliteInfoUI()
</h2>
<table class="signature">
<tr>
<td>
CSatelliteInfoUI
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
C++ default constructor.
</p>
</div>
</div>
</div>
<div class="nested1" id="GUID-93A99578-A735-3F5A-A355-73E54FC03D4D">
<a name="GUID-93A99578-A735-3F5A-A355-73E54FC03D4D">
<!-- -->
</a>
<h2 class="topictitle2">
~CSatelliteInfoUI()
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C
</td>
<td>
~CSatelliteInfoUI
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[virtual]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Destructor.
</p>
</div>
</div>
</div>
<h1 class="pageHeading topictitle1">
Member Functions Documentation
</h1>
<div class="nested1" id="GUID-4E54AE35-8E26-3D97-B67E-1270F69CF2B8">
<a name="GUID-4E54AE35-8E26-3D97-B67E-1270F69CF2B8">
<!-- -->
</a>
<h2 class="topictitle2">
ConstructL()
</h2>
<table class="signature">
<tr>
<td>
void
</td>
<td>
ConstructL
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
By default Symbian 2nd phase constructor is private.
</p>
</div>
</div>
</div>
<div class="nested1" id="GUID-0952B6DA-56C1-3D73-881F-13B0B61189BC">
<a name="GUID-0952B6DA-56C1-3D73-881F-13B0B61189BC">
<!-- -->
</a>
<h2 class="topictitle2">
ExecuteLD(const TDesC &)
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
ExecuteLD
</td>
<td>
(
</td>
<td>
const
<a href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.html">
TDesC
</a>
&
</td>
<td>
aNameOfRule
</td>
<td>
)
</td>
<td>
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Display satellite's information dialog.
</p>
<p>
This library uses the services provided by Location Framework. Once the dialog is launched satellite information is continuously requested via Location Acquisition API. The Location Acquisition API is offered by Location Framework. The user can switch between the two views once the dialog is launched.
</p>
<div class="p">
<dl class="user">
<dt class="dlterm">
<strong>
leave
</strong>
</dt>
<dd>
KErrArgument if requestor data (aNameOfRule argument) length exceeds 255 characters or if it is empty. This function may also leave with any one of the standard error codes such as out of memory (e.g. KErrNoMemory)
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
const
<a href="GUID-440FF2B4-353B-3097-A2BA-5887D10B8B23.html">
TDesC
</a>
& aNameOfRule
</td>
<td>
is requestor data for Location FW which will be used for privacy verification in the future. Application name should be used to specify the requestor. The string should not be empty.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-701C4261-F095-3690-9E66-6866C00EF918">
<a name="GUID-701C4261-F095-3690-9E66-6866C00EF918">
<!-- -->
</a>
<h2 class="topictitle2">
HandleForegroundEventL(TBool)
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C void
</td>
<td>
HandleForegroundEventL
</td>
<td>
(
</td>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
</td>
<td>
aForeground
</td>
<td>
)
</td>
<td>
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Dialog switched to foreground or background
</p>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
aForeground
</td>
<td>
ETrue to switch to the foreground. EFalse to switch to background.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-B2D49139-004F-3CDA-8D1C-C44C6E16BDA1">
<a name="GUID-B2D49139-004F-3CDA-8D1C-C44C6E16BDA1">
<!-- -->
</a>
<h2 class="topictitle2">
NewL()
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html">
CSatelliteInfoUI
</a>
*
</td>
<td>
NewL
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[static]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Two-phased constructor.
</p>
<p>
</p>
</div>
</div>
</div>
<div class="nested1" id="GUID-1FABF8E8-FFE9-373B-90A4-ABE7A2290B1B">
<a name="GUID-1FABF8E8-FFE9-373B-90A4-ABE7A2290B1B">
<!-- -->
</a>
<h2 class="topictitle2">
SetLaunchView(TSatelliteView)
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C void
</td>
<td>
SetLaunchView
</td>
<td>
(
</td>
<td>
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html">
TSatelliteView
</a>
</td>
<td>
aLaunchView
</td>
<td>
)
</td>
<td>
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Used to set the dialog's launch view
</p>
<p>
This method is used to set the view in which the dialog should be launched. The two available views are signal strength and firmament view. Constants for settings default view specified in enum
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html#GUID-CB34AEA2-3200-36E2-B794-9A637EF844E7">
TSatelliteView
</a>
. This method should be called before the method
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html#GUID-0952B6DA-56C1-3D73-881F-13B0B61189BC">
ExecuteLD
</a>
is invoked.
</p>
<div class="p">
<dl class="user">
<dt class="dlterm">
<strong>
panic
</strong>
</dt>
<dd>
EAknPanicOutOfRange if the method is invoked with an invalid parameter. Values provided apart from those specified in
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html#GUID-CB34AEA2-3200-36E2-B794-9A637EF844E7">
TSatelliteView
</a>
are invalid and will cause the method to panic.
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html">
TSatelliteView
</a>
aLaunchView
</td>
<td>
ESatelliteFirmamentView for firmament view and ESatelliteSignalStrengthView for signal strength view. ESatelliteCompassView for compass ciew ESatelliteCompassView Visibility will be variated depending on the product configuration/regional variation. if it is disabled to show compass view then function will ignore the ESatelliteCompassView and show firmament view instead.
</td>
</tr>
</table>
</div>
</div>
<h1 class="pageHeading topictitle1">
Member Enumerations Documentation
</h1>
<div class="nested1" id="GUID-CB34AEA2-3200-36E2-B794-9A637EF844E7">
<a name="GUID-CB34AEA2-3200-36E2-B794-9A637EF844E7">
<!-- -->
</a>
<h2 class="topictitle2">
Enum TSatelliteView
</h2>
<div class="section">
<div>
<p>
Enumeration to specify the default launch view of the dialog.
</p>
</div>
</div>
<div class="section enumerators">
<h3 class="sectiontitle">
Enumerators
</h3>
<table border="0" class="enumerators">
<tr>
<td valign="top">
ESatelliteFirmamentView = 0x0001
</td>
<td>
<p>
Launch option for firmament view. Firmament view displays all the satellites in view with the satellite's number on a firmament.
</p>
</td>
</tr>
<tr class="bg">
<td valign="top">
ESatelliteSignalStrengthView = 0x0002
</td>
<td>
<p>
Launch option for signal strength view. Signal strength view displays all the satellite with their correspoinding signal strength represented by bars.
</p>
</td>
</tr>
<tr>
<td valign="top">
ESatelliteCompassView = 0x0003
</td>
<td>
<p>
Launch option for compass view. Compass view displays latitude, longitude, speed and direction along with 2D/3D type of Fix.
</p>
</td>
</tr>
</table>
</div>
</div>
<h1 class="pageHeading topictitle1">
Member Data Documentation
</h1>
<div class="nested1" id="GUID-D5ECE435-475B-37E7-A6D8-2C499F65937F">
<a name="GUID-D5ECE435-475B-37E7-A6D8-2C499F65937F">
<!-- -->
</a>
<h2 class="topictitle2">
TBool * iDestroyedPtr
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
*
</td>
<td>
iDestroyedPtr
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-8912768F-47F8-31B9-90EF-CD3681D43EA9">
<a name="GUID-8912768F-47F8-31B9-90EF-CD3681D43EA9">
<!-- -->
</a>
<h2 class="topictitle2">
CSatellite * iSatellite
</h2>
<table class="signature">
<tr>
<td>
CSatellite *
</td>
<td>
iSatellite
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Own: A pointer to CSatellite. Contains the engine and the dialog implementation.
</p>
</div>
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-DD9674C9-445A-36D8-A4EF-5384D3EF74BA.html | HTML | epl-1.0 | 21,495 | 24.068845 | 382 | 0.502351 | false |
/*
* Copyright (c) 2013 Cisco Systems, Inc. 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
*/
package org.opendaylight.controller.netconf.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anySetOf;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.io.ByteStreams;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.HashedWheelTimer;
import io.netty.util.concurrent.GlobalEventExecutor;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.opendaylight.controller.config.util.capability.Capability;
import org.opendaylight.controller.config.util.xml.DocumentedException;
import org.opendaylight.controller.config.util.xml.XmlUtil;
import org.opendaylight.controller.netconf.api.NetconfMessage;
import org.opendaylight.controller.netconf.api.monitoring.CapabilityListener;
import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.controller.netconf.client.NetconfClientDispatcher;
import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
import org.opendaylight.controller.netconf.client.TestingNetconfClient;
import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
import org.opendaylight.controller.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedExecution;
import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.controller.netconf.nettyutil.handler.exi.NetconfStartExiMessage;
import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
import org.opendaylight.controller.netconf.util.messages.NetconfMessageUtil;
import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
import org.opendaylight.protocol.framework.NeverReconnectStrategy;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.CapabilitiesBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
@RunWith(Parameterized.class)
public class ConcurrentClientsTest {
private static final Logger LOG = LoggerFactory.getLogger(ConcurrentClientsTest.class);
private static ExecutorService clientExecutor;
private static final int CONCURRENCY = 32;
private static final InetSocketAddress netconfAddress = new InetSocketAddress("127.0.0.1", 8303);
private int nettyThreads;
private Class<? extends Runnable> clientRunnable;
private Set<String> serverCaps;
public ConcurrentClientsTest(int nettyThreads, Class<? extends Runnable> clientRunnable, Set<String> serverCaps) {
this.nettyThreads = nettyThreads;
this.clientRunnable = clientRunnable;
this.serverCaps = serverCaps;
}
@Parameterized.Parameters()
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{{4, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
{1, TestingNetconfClientRunnable.class, NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES},
// empty set of capabilities = only base 1.0 netconf capability
{4, TestingNetconfClientRunnable.class, Collections.emptySet()},
{4, TestingNetconfClientRunnable.class, getOnlyExiServerCaps()},
{4, TestingNetconfClientRunnable.class, getOnlyChunkServerCaps()},
{4, BlockingClientRunnable.class, getOnlyExiServerCaps()},
{1, BlockingClientRunnable.class, getOnlyExiServerCaps()},
});
}
private EventLoopGroup nettyGroup;
private NetconfClientDispatcher netconfClientDispatcher;
HashedWheelTimer hashedWheelTimer;
private TestingNetconfOperation testingNetconfOperation;
public static NetconfMonitoringService createMockedMonitoringService() {
NetconfMonitoringService monitoring = mock(NetconfMonitoringService.class);
doNothing().when(monitoring).onSessionUp(any(NetconfServerSession.class));
doNothing().when(monitoring).onSessionDown(any(NetconfServerSession.class));
doReturn(new AutoCloseable() {
@Override
public void close() throws Exception {
}
}).when(monitoring).registerListener(any(NetconfMonitoringService.MonitoringListener.class));
doNothing().when(monitoring).onCapabilitiesChanged(anySetOf(Capability.class), anySetOf(Capability.class));
doReturn(new CapabilitiesBuilder().setCapability(Collections.<Uri>emptyList()).build()).when(monitoring).getCapabilities();
return monitoring;
}
@BeforeClass
public static void setUpClientExecutor() {
clientExecutor = Executors.newFixedThreadPool(CONCURRENCY, new ThreadFactory() {
int i = 1;
@Override
public Thread newThread(final Runnable r) {
Thread thread = new Thread(r);
thread.setName("client-" + i++);
thread.setDaemon(true);
return thread;
}
});
}
@Before
public void setUp() throws Exception {
hashedWheelTimer = new HashedWheelTimer();
nettyGroup = new NioEventLoopGroup(nettyThreads);
netconfClientDispatcher = new NetconfClientDispatcherImpl(nettyGroup, nettyGroup, hashedWheelTimer);
AggregatedNetconfOperationServiceFactory factoriesListener = new AggregatedNetconfOperationServiceFactory();
testingNetconfOperation = new TestingNetconfOperation();
factoriesListener.onAddNetconfOperationServiceFactory(new TestingOperationServiceFactory(testingNetconfOperation));
SessionIdProvider idProvider = new SessionIdProvider();
NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
hashedWheelTimer, factoriesListener, idProvider, 5000, createMockedMonitoringService(), serverCaps);
NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
final NetconfServerDispatcherImpl dispatch = new NetconfServerDispatcherImpl(serverChannelInitializer, nettyGroup, nettyGroup);
ChannelFuture s = dispatch.createServer(netconfAddress);
s.await();
}
@After
public void tearDown(){
hashedWheelTimer.stop();
try {
nettyGroup.shutdownGracefully().get();
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Ignoring exception while cleaning up after test", e);
}
}
@AfterClass
public static void tearDownClientExecutor() {
clientExecutor.shutdownNow();
}
@Test(timeout = CONCURRENCY * 1000)
public void testConcurrentClients() throws Exception {
List<Future<?>> futures = Lists.newArrayListWithCapacity(CONCURRENCY);
for (int i = 0; i < CONCURRENCY; i++) {
futures.add(clientExecutor.submit(getInstanceOfClientRunnable()));
}
for (Future<?> future : futures) {
try {
future.get();
} catch (InterruptedException e) {
throw new IllegalStateException(e);
} catch (ExecutionException e) {
LOG.error("Thread for testing client failed", e);
fail("Client failed: " + e.getMessage());
}
}
assertEquals(CONCURRENCY, testingNetconfOperation.getMessageCount());
}
public static Set<String> getOnlyExiServerCaps() {
return Sets.newHashSet(
XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_0,
XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0
);
}
public static Set<String> getOnlyChunkServerCaps() {
return Sets.newHashSet(
XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_0,
XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1
);
}
public Runnable getInstanceOfClientRunnable() throws Exception {
return clientRunnable.getConstructor(ConcurrentClientsTest.class).newInstance(this);
}
/**
* Responds to all operations except start-exi and counts all requests
*/
private static class TestingNetconfOperation implements NetconfOperation {
private final AtomicLong counter = new AtomicLong();
@Override
public HandlingPriority canHandle(Document message) {
return XmlUtil.toString(message).contains(NetconfStartExiMessage.START_EXI) ?
HandlingPriority.CANNOT_HANDLE :
HandlingPriority.HANDLE_WITH_MAX_PRIORITY;
}
@Override
public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation) throws DocumentedException {
try {
LOG.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
counter.getAndIncrement();
return XmlUtil.readXmlToDocument("<test/>");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public long getMessageCount() {
return counter.get();
}
}
/**
* Hardcoded operation service factory
*/
private static class TestingOperationServiceFactory implements NetconfOperationServiceFactory {
private final NetconfOperation[] operations;
public TestingOperationServiceFactory(final NetconfOperation... operations) {
this.operations = operations;
}
@Override
public Set<Capability> getCapabilities() {
return Collections.emptySet();
}
@Override
public AutoCloseable registerCapabilityListener(final CapabilityListener listener) {
return new AutoCloseable(){
@Override
public void close() throws Exception {}
};
}
@Override
public NetconfOperationService createService(String netconfSessionIdForReporting) {
return new NetconfOperationService() {
@Override
public Set<NetconfOperation> getNetconfOperations() {
return Sets.newHashSet(operations);
}
@Override
public void close() {}
};
}
}
/**
* Pure socket based blocking client
*/
public final class BlockingClientRunnable implements Runnable {
@Override
public void run() {
try {
run2();
} catch (Exception e) {
throw new IllegalStateException(Thread.currentThread().getName(), e);
}
}
private void run2() throws Exception {
InputStream clientHello = checkNotNull(XmlFileLoader
.getResourceAsStream("netconfMessages/client_hello.xml"));
InputStream getConfig = checkNotNull(XmlFileLoader.getResourceAsStream("netconfMessages/getConfig.xml"));
Socket clientSocket = new Socket(netconfAddress.getHostString(), netconfAddress.getPort());
DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
InputStreamReader inFromServer = new InputStreamReader(clientSocket.getInputStream());
StringBuffer sb = new StringBuffer();
while (sb.toString().endsWith("]]>]]>") == false) {
sb.append((char) inFromServer.read());
}
LOG.info(sb.toString());
outToServer.write(ByteStreams.toByteArray(clientHello));
outToServer.write("]]>]]>".getBytes());
outToServer.flush();
// Thread.sleep(100);
outToServer.write(ByteStreams.toByteArray(getConfig));
outToServer.write("]]>]]>".getBytes());
outToServer.flush();
Thread.sleep(100);
sb = new StringBuffer();
while (sb.toString().endsWith("]]>]]>") == false) {
sb.append((char) inFromServer.read());
}
LOG.info(sb.toString());
clientSocket.close();
}
}
/**
* TestingNetconfClient based runnable
*/
public final class TestingNetconfClientRunnable implements Runnable {
@Override
public void run() {
try {
final TestingNetconfClient netconfClient =
new TestingNetconfClient(Thread.currentThread().getName(), netconfClientDispatcher, getClientConfig());
long sessionId = netconfClient.getSessionId();
LOG.info("Client with session id {}: hello exchanged", sessionId);
final NetconfMessage getMessage = XmlFileLoader
.xmlFileToNetconfMessage("netconfMessages/getConfig.xml");
NetconfMessage result = netconfClient.sendRequest(getMessage).get();
LOG.info("Client with session id {}: got result {}", sessionId, result);
Preconditions.checkState(NetconfMessageUtil.isErrorMessage(result) == false,
"Received error response: " + XmlUtil.toString(result.getDocument()) + " to request: "
+ XmlUtil.toString(getMessage.getDocument()));
netconfClient.close();
LOG.info("Client with session id {}: ended", sessionId);
} catch (final Exception e) {
throw new IllegalStateException(Thread.currentThread().getName(), e);
}
}
private NetconfClientConfiguration getClientConfig() {
final NetconfClientConfigurationBuilder b = NetconfClientConfigurationBuilder.create();
b.withAddress(netconfAddress);
b.withAdditionalHeader(new NetconfHelloMessageAdditionalHeader("uname", "10.10.10.1", "830", "tcp",
"client"));
b.withSessionListener(new SimpleNetconfClientSessionListener());
b.withReconnectStrategy(new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE,
NetconfClientConfigurationBuilder.DEFAULT_CONNECTION_TIMEOUT_MILLIS));
return b.build();
}
}
}
| tx1103mark/controller | opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/ConcurrentClientsTest.java | Java | epl-1.0 | 16,612 | 42.373368 | 170 | 0.686492 | false |
var config = {
type: Phaser.WEBGL,
parent: 'phaser-example',
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload() {
this.load.image('bunny', 'assets/sprites/bunny.png');
}
function create() {
var parent = this.add.image(0, 0, 'bunny');
var child = this.add.image(100, 100, 'bunny');
parent.alpha = 0.5;
}
| boniatillo-com/PhaserEditor | source/v2/phasereditor/phasereditor.resources.phaser.examples/phaser3-examples/public/src/archived/091 image parent alpha.js | JavaScript | epl-1.0 | 411 | 14.807692 | 57 | 0.583942 | false |
/*******************************************************************************
* Copyright (c) 2007, 2008 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.jdt.core.refactoring.participants;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.IParticipantDescriptorFilter;
import org.eclipse.ltk.core.refactoring.participants.ParticipantExtensionPoint;
import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
import org.eclipse.jdt.core.IMethod;
/**
* Facade to access participants to the participant extension points
* provided by the org.eclipse.jdt.core.manipulation plug-in.
* <p>
* Note: this class is not intended to be extended or instantiated by clients.
* </p>
*
* @since 1.2
*
* @noinstantiate This class is not intended to be instantiated by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class JavaParticipantManager {
private final static String PLUGIN_ID= "org.eclipse.jdt.core.manipulation"; //$NON-NLS-1$
private JavaParticipantManager() {
// no instance
}
//---- Change method signature participants ----------------------------------------------------------------
private static final String METHOD_SIGNATURE_PARTICIPANT_EXT_POINT= "changeMethodSignatureParticipants"; //$NON-NLS-1$
private static ParticipantExtensionPoint fgMethodSignatureInstance=
new ParticipantExtensionPoint(PLUGIN_ID, METHOD_SIGNATURE_PARTICIPANT_EXT_POINT, ChangeMethodSignatureParticipant.class);
/**
* Loads the change method signature participants for the given element.
*
* @param status a refactoring status to report status if problems occurred while
* loading the participants
* @param processor the processor that will own the participants
* @param method the method to be changed
* @param arguments the change method signature arguments describing the change
* @param filter a participant filter to exclude certain participants, or <code>null</code>
* if no filtering is desired
* @param affectedNatures an array of project natures affected by the refactoring
* @param shared a list of shared participants
*
* @return an array of change method signature participants
*/
public static ChangeMethodSignatureParticipant[] loadChangeMethodSignatureParticipants(RefactoringStatus status, RefactoringProcessor processor, IMethod method, ChangeMethodSignatureArguments arguments, IParticipantDescriptorFilter filter, String[] affectedNatures, SharableParticipants shared) {
RefactoringParticipant[] participants= fgMethodSignatureInstance.getParticipants(status, processor, method, arguments, filter, affectedNatures, shared);
ChangeMethodSignatureParticipant[] result= new ChangeMethodSignatureParticipant[participants.length];
System.arraycopy(participants, 0, result, 0, participants.length);
return result;
}
} | maxeler/eclipse | eclipse.jdt.ui/org.eclipse.jdt.core.manipulation/refactoring/org/eclipse/jdt/core/refactoring/participants/JavaParticipantManager.java | Java | epl-1.0 | 3,457 | 47.704225 | 297 | 0.746601 | false |
# clj-oauth2-token-generator
This is a server which can be used to generate OAuth2 tokens for
Google services. Tokens are stored in EDN files to be used by the
main application.
This illustrates the usage for the
[clj-oauth2 library](https://clojars.org/stuarth/clj-oauth2) as
described in the
[Blog post by Eric Koslow](https://coderwall.com/p/y9w4-g/google-oauth2-in-clojure).
## Options
Put a config.edn file into the resources directory. Use
config-sample.edn as example.
## Usage
$ lein run
Send your users to the ```/google-oauth``` URL on your server to
generate a token.
## License
Copyright © 2015 Hans Hübner
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
| hanshuebner/clj-oauth2-token-generator | README.md | Markdown | epl-1.0 | 744 | 24.586207 | 84 | 0.753369 | false |
package com.teamNikaml.bipinography.activity;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.Toast;
import com.android.volley.Request.Method;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.teamNikaml.bipinography.app.AppConst;
import com.teamNikaml.bipinography.app.AppController;
import com.teamNikaml.bipinography.helper.AppRater;
import com.teamNikaml.bipinography.picasa.model.Category;
public class SplashActivity extends Activity {
private static final String TAG = SplashActivity.class.getSimpleName();
private static final String TAG_FEED = "feed", TAG_ENTRY = "entry",
TAG_GPHOTO_ID = "gphoto$id", TAG_T = "$t",
TAG_ALBUM_TITLE = "title";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getActionBar().hide();
setContentView(R.layout.activity_splash);
AppRater.app_launched(this);
// Picasa request to get list of albums
String url = AppConst.URL_PICASA_ALBUMS
.replace("_PICASA_USER_", AppController.getInstance()
.getPrefManger().getGoogleUserName());
// Preparing volley's json object request
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.GET, url,
null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
List<Category> albums = new ArrayList<Category>();
try {
// Parsing the json response
JSONArray entry = response.getJSONObject(TAG_FEED)
.getJSONArray(TAG_ENTRY);
// loop through albums nodes and add them to album
// list
for (int i = 0; i < entry.length(); i++) {
JSONObject albumObj = (JSONObject) entry.get(i);
// album id
String albumId = albumObj.getJSONObject(
TAG_GPHOTO_ID).getString(TAG_T);
// album title
String albumTitle = albumObj.getJSONObject(
TAG_ALBUM_TITLE).getString(TAG_T);
Category album = new Category();
album.setId(albumId);
album.setTitle(albumTitle);
// add album to list
albums.add(album);
}
// Store albums in shared pref
AppController.getInstance().getPrefManger()
.storeCategories(albums);
// String the main activity
Intent intent = new Intent(getApplicationContext(),
WallpaperActivity.class);
startActivity(intent);
// closing spalsh activity
finish();
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(),
getString(R.string.msg_unknown_error),
Toast.LENGTH_LONG).show();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// show error toast
Toast.makeText(getApplicationContext(),
getString(R.string.splash_error),
Toast.LENGTH_LONG).show();
// Unable to fetch albums
// check for existing Albums data in Shared Preferences
if (AppController.getInstance().getPrefManger()
.getCategories() != null && AppController.getInstance().getPrefManger()
.getCategories().size() > 0) {
// String the main activity
Intent intent = new Intent(getApplicationContext(),
WallpaperActivity.class);
startActivity(intent);
// closing spalsh activity
finish();
} else {
// Albums data not present in the shared preferences
// Launch settings activity, so that user can modify
// the settings
Intent i = new Intent(SplashActivity.this,
SettingsActivity.class);
// clear all the activities
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
}
}
});
// disable the cache for this request, so that it always fetches updated
// json
jsonObjReq.setShouldCache(false);
// Making the request
AppController.getInstance().addToRequestQueue(jsonObjReq);
}
}
| TeamNIKaml/LiveWallpaper | Awesome Wallpapers/src/com/teamNikaml/bipinography/activity/SplashActivity.java | Java | epl-1.0 | 4,397 | 28.510067 | 79 | 0.673186 | false |
package fr.obeo.dsl.minidrone.application;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
protected void makeActions(IWorkbenchWindow window) {
}
protected void fillMenuBar(IMenuManager menuBar) {
}
}
| mbats/minidrone | plugins/fr.obeo.dsl.minidrone.application/src/fr/obeo/dsl/minidrone/application/ApplicationActionBarAdvisor.java | Java | epl-1.0 | 549 | 26.45 | 73 | 0.785064 | false |
/**
* Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Eclipse Public License (EPL).
* Please see the license.txt included with this distribution for details.
* Any modifications to this file must keep this entire header intact.
*/
/*
* Created on 25/08/2005
*
* @author Fabio Zadrozny
*/
package com.python.pydev.codecompletion.participant;
import java.io.File;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.text.Document;
import org.python.pydev.ast.codecompletion.PyCodeCompletion;
import org.python.pydev.ast.codecompletion.PyCodeCompletionPreferences;
import org.python.pydev.ast.codecompletion.revisited.modules.SourceToken;
import org.python.pydev.core.IToken;
import org.python.pydev.core.TestDependent;
import org.python.pydev.core.TokensList;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.actions.PySelectionTest;
import org.python.pydev.editor.codecompletion.proposals.CtxInsensitiveImportComplProposal;
import org.python.pydev.editor.codecompletion.proposals.DefaultCompletionProposalFactory;
import org.python.pydev.parser.jython.ast.Import;
import org.python.pydev.parser.jython.ast.NameTok;
import org.python.pydev.parser.jython.ast.aliasType;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.preferences.InMemoryEclipsePreferences;
import com.python.pydev.analysis.AnalysisPreferences;
import com.python.pydev.analysis.additionalinfo.AdditionalInfoTestsBase;
import com.python.pydev.codecompletion.ctxinsensitive.CtxParticipant;
public class CompletionParticipantTest extends AdditionalInfoTestsBase {
public static void main(String[] args) {
CompletionParticipantTest test = new CompletionParticipantTest();
try {
test.setUp();
test.testImportCompletionFromZip();
test.tearDown();
junit.textui.TestRunner.run(CompletionParticipantTest.class);
} catch (Throwable e) {
e.printStackTrace();
}
}
@Override
public void setUp() throws Exception {
// forceAdditionalInfoRecreation = true; -- just for testing purposes
super.setUp();
codeCompletion = new PyCodeCompletion();
CompletionProposalFactory.set(new DefaultCompletionProposalFactory());
}
@Override
public void tearDown() throws Exception {
super.tearDown();
PyCodeCompletionPreferences.getPreferencesForTests = null;
CompletionProposalFactory.set(null);
}
@Override
protected String getSystemPythonpathPaths() {
return TestDependent.getCompletePythonLib(true, isPython3Test()) + "|" + TestDependent.TEST_PYSRC_TESTING_LOC
+ "myzipmodule.zip"
+ "|"
+ TestDependent.TEST_PYSRC_TESTING_LOC + "myeggmodule.egg";
}
public void testImportCompletion() throws Exception {
participant = new ImportsCompletionParticipant();
//check simple
ICompletionProposalHandle[] proposals = requestCompl(
"unittest", -1, -1, new String[] { "unittest", "unittest - testlib" }); //the unittest module and testlib.unittest
Document document = new Document("unittest");
ICompletionProposalHandle p0 = null;
ICompletionProposalHandle p1 = null;
for (ICompletionProposalHandle p : proposals) {
String displayString = p.getDisplayString();
if (displayString.equals("unittest")) {
p0 = p;
} else if (displayString.equals("unittest - testlib")) {
p1 = p;
}
}
if (p0 == null) {
fail("Could not find unittest import");
}
if (p1 == null) {
fail("Could not find unittest - testlib import");
}
((CtxInsensitiveImportComplProposal) p0).indentString = " ";
((CtxInsensitiveImportComplProposal) p0).apply(document, ' ', 0, 8);
PySelectionTest.checkStrEquals("import unittest\r\nunittest", document.get());
document = new Document("unittest");
((CtxInsensitiveImportComplProposal) p1).indentString = " ";
((CtxInsensitiveImportComplProposal) p1).apply(document, ' ', 0, 8);
PySelectionTest.checkStrEquals("from testlib import unittest\r\nunittest", document.get());
document = new Document("unittest");
final IEclipsePreferences prefs = new InMemoryEclipsePreferences();
PyCodeCompletionPreferences.getPreferencesForTests = () -> prefs;
document = new Document("unittest");
prefs.putBoolean(PyCodeCompletionPreferences.APPLY_COMPLETION_ON_DOT, false);
((CtxInsensitiveImportComplProposal) p1).indentString = " ";
((CtxInsensitiveImportComplProposal) p1).apply(document, '.', 0, 8);
PySelectionTest.checkStrEquals("unittest.", document.get());
document = new Document("unittest");
prefs.putBoolean(PyCodeCompletionPreferences.APPLY_COMPLETION_ON_DOT, true);
((CtxInsensitiveImportComplProposal) p1).indentString = " ";
((CtxInsensitiveImportComplProposal) p1).apply(document, '.', 0, 8);
PySelectionTest.checkStrEquals("from testlib import unittest\r\nunittest.", document.get());
//for imports, the behavior never changes
AnalysisPreferences.TESTS_DO_IGNORE_IMPORT_STARTING_WITH_UNDER = true;
try {
proposals = requestCompl("_priv3", new String[] { "_priv3 - relative.rel1._priv1._priv2" });
document = new Document("_priv3");
((CtxInsensitiveImportComplProposal) proposals[0]).indentString = " ";
((CtxInsensitiveImportComplProposal) proposals[0]).apply(document, ' ', 0, 6);
PySelectionTest.checkStrEquals("from relative.rel1._priv1._priv2 import _priv3\r\n_priv3", document.get());
} finally {
AnalysisPreferences.TESTS_DO_IGNORE_IMPORT_STARTING_WITH_UNDER = false;
}
//check on actual file
requestCompl(new File(TestDependent.TEST_PYSRC_TESTING_LOC + "/testlib/unittest/guitestcase.py"), "guite", -1,
0,
new String[] {});
Import importTok = new Import(new aliasType[] { new aliasType(new NameTok("unittest", NameTok.ImportModule),
null) });
this.imports = new TokensList(new IToken[] { new SourceToken(importTok, "unittest", "", "", "", null) });
requestCompl("import unittest\nunittest", new String[] {}); //none because the import for unittest is already there
requestCompl("import unittest\nunittes", new String[] {}); //the local import for unittest (won't actually show anything because we're only exercising the participant test)
this.imports = null;
}
public void testImportCompletionFromZip2() throws Exception {
participant = new ImportsCompletionParticipant();
ICompletionProposalHandle[] proposals = requestCompl("myzip", -1, -1, new String[] {});
assertContains("myzipfile - myzipmodule", proposals);
assertContains("myzipmodule", proposals);
proposals = requestCompl("myegg", -1, -1, new String[] {});
assertContains("myeggfile - myeggmodule", proposals);
assertContains("myeggmodule", proposals);
}
public void testImportCompletionFromZip() throws Exception {
participant = new CtxParticipant();
ICompletionProposalHandle[] proposals = requestCompl("myzipc", -1, -1, new String[] {});
assertContains("MyZipClass - myzipmodule.myzipfile", proposals);
proposals = requestCompl("myegg", -1, -1, new String[] {});
assertContains("MyEggClass - myeggmodule.myeggfile", proposals);
}
public void testImportCompletion2() throws Exception {
participant = new CtxParticipant();
ICompletionProposalHandle[] proposals = requestCompl("xml", -1, -1, new String[] {});
assertNotContains("xml - xmlrpclib", proposals);
requestCompl(new File(TestDependent.TEST_PYSRC_TESTING_LOC + "/testlib/unittest/guitestcase.py"), "guite", -1,
0,
new String[] {});
//the behavior changes for tokens on modules
AnalysisPreferences.TESTS_DO_IGNORE_IMPORT_STARTING_WITH_UNDER = true;
try {
proposals = requestCompl("Priv3", new String[] { "Priv3 - relative.rel1._priv1._priv2._priv3" });
Document document = new Document("Priv3");
((CtxInsensitiveImportComplProposal) proposals[0]).indentString = " ";
((CtxInsensitiveImportComplProposal) proposals[0]).apply(document, ' ', 0, 5);
PySelectionTest.checkStrEquals("from relative.rel1 import Priv3\r\nPriv3", document.get());
} finally {
AnalysisPreferences.TESTS_DO_IGNORE_IMPORT_STARTING_WITH_UNDER = false;
}
}
}
| fabioz/Pydev | plugins/org.python.pydev/tests_codecompletion/com/python/pydev/codecompletion/participant/CompletionParticipantTest.java | Java | epl-1.0 | 8,997 | 45.376289 | 180 | 0.675447 | false |
package treehou.se.habit.ui.util;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.mikepenz.community_material_typeface_library.CommunityMaterial;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.iconics.typeface.IIcon;
import java.util.ArrayList;
import java.util.List;
import treehou.se.habit.R;
import treehou.se.habit.util.Util;
/**
* Fragment for picking categories of icons.
*/
public class CategoryPickerFragment extends Fragment {
private RecyclerView lstIcons;
private CategoryAdapter adapter;
private ViewGroup container;
public static CategoryPickerFragment newInstance() {
CategoryPickerFragment fragment = new CategoryPickerFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
public CategoryPickerFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_icon_picker, null);
lstIcons = (RecyclerView) rootView.findViewById(R.id.lst_categories);
lstIcons.setItemAnimator(new DefaultItemAnimator());
lstIcons.setLayoutManager(new LinearLayoutManager(getActivity()));
// Hookup list of categories
adapter = new CategoryAdapter(getActivity());
adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_play, getString(R.string.media), Util.IconCategory.MEDIA));
adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_alarm, getString(R.string.sensor), Util.IconCategory.SENSORS));
adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_power, getString(R.string.command), Util.IconCategory.COMMANDS));
adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_arrow_up, getString(R.string.arrows), Util.IconCategory.ARROWS));
adapter.add(new CategoryPicker(CommunityMaterial.Icon.cmd_view_module, getString(R.string.all), Util.IconCategory.ALL));
lstIcons.setAdapter(adapter);
this.container = container;
return rootView;
}
private class CategoryPicker {
private IIcon icon;
private String category;
private Util.IconCategory id;
public CategoryPicker(IIcon icon, String category, Util.IconCategory id) {
this.icon = icon;
this.category = category;
this.id = id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public IIcon getIcon() {
return icon;
}
public void setIcon(IIcon icon) {
this.icon = icon;
}
public Util.IconCategory getId() {
return id;
}
public void setId(Util.IconCategory id) {
this.id = id;
}
}
private class CategoryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private Context context;
private List<CategoryPicker> categories = new ArrayList<>();
class CategoryHolder extends RecyclerView.ViewHolder {
public ImageView imgIcon;
public TextView lblCategory;
public CategoryHolder(View itemView) {
super(itemView);
imgIcon = (ImageView) itemView.findViewById(R.id.img_menu);
lblCategory = (TextView) itemView.findViewById(R.id.lbl_label);
}
}
public CategoryAdapter(Context context) {
this.context = context;
}
public void add(CategoryPicker category){
categories.add(category);
notifyDataSetChanged();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View itemView = inflater.inflate(R.layout.item_category, parent, false);
return new CategoryHolder(itemView);
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
final CategoryPicker item = categories.get(position);
CategoryHolder catHolder = (CategoryHolder) holder;
IconicsDrawable drawable = new IconicsDrawable(getActivity(), item.getIcon()).color(Color.BLACK).sizeDp(50);
catHolder.imgIcon.setImageDrawable(drawable);
catHolder.lblCategory.setText(item.getCategory());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().getSupportFragmentManager().beginTransaction()
.replace(container.getId(), IconPickerFragment.newInstance(item.getId()))
.addToBackStack(null)
.commit();
}
});
}
@Override
public int getItemCount() {
return categories.size();
}
}
}
| pravussum/3House | mobile/src/main/java/treehou/se/habit/ui/util/CategoryPickerFragment.java | Java | epl-1.0 | 5,601 | 31.563953 | 131 | 0.657561 | false |
/*******************************************************************************
* Copyright 2009 Regents of the University of Minnesota. All rights
* reserved.
* Copyright 2009 Mayo Foundation for Medical Education and Research.
* All rights reserved.
*
* This program is 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
* IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
* OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
* PARTICULAR PURPOSE. See the License for the specific language
* governing permissions and limitations under the License.
*
* Contributors:
* Minnesota Supercomputing Institute - initial API and implementation
******************************************************************************/
package edu.umn.msi.tropix.persistence.service;
import javax.annotation.Nullable;
import edu.umn.msi.tropix.models.ITraqQuantitationAnalysis;
import edu.umn.msi.tropix.persistence.aop.Modifies;
import edu.umn.msi.tropix.persistence.aop.PersistenceMethod;
import edu.umn.msi.tropix.persistence.aop.Reads;
import edu.umn.msi.tropix.persistence.aop.UserId;
public interface ITraqQuantitationAnalysisService {
@PersistenceMethod
ITraqQuantitationAnalysis createQuantitationAnalysis(@UserId String userId, @Nullable @Modifies String destinationId, ITraqQuantitationAnalysis quantitationAnalysis, @Modifies String dataReportId, @Reads String[] inputRunIds, @Nullable @Reads String trainingId, @Modifies String outputFileId);
}
| jmchilton/TINT | projects/TropixPersistence/src/service-api/edu/umn/msi/tropix/persistence/service/ITraqQuantitationAnalysisService.java | Java | epl-1.0 | 1,827 | 49.75 | 297 | 0.732348 | false |
/**
* Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Eclipse Public License (EPL).
* Please see the license.txt included with this distribution for details.
* Any modifications to this file must keep this entire header intact.
*/
/*
* Created on May 24, 2005
*
* @author Fabio Zadrozny
*/
package org.python.pydev.editor.codecompletion.revisited;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.python.pydev.core.DeltaSaver;
import org.python.pydev.core.ICodeCompletionASTManager;
import org.python.pydev.core.IInterpreterInfo;
import org.python.pydev.core.IInterpreterManager;
import org.python.pydev.core.IModule;
import org.python.pydev.core.IModulesManager;
import org.python.pydev.core.IProjectModulesManager;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.IPythonPathNature;
import org.python.pydev.core.ISystemModulesManager;
import org.python.pydev.core.ModulesKey;
import org.python.pydev.core.log.Log;
import org.python.pydev.editor.codecompletion.revisited.javaintegration.JavaProjectModulesManagerCreator;
import org.python.pydev.plugin.nature.PythonNature;
import org.python.pydev.shared_core.io.FileUtils;
import org.python.pydev.shared_core.string.StringUtils;
import org.python.pydev.shared_core.structure.Tuple;
/**
* @author Fabio Zadrozny
*/
public final class ProjectModulesManager extends ModulesManagerWithBuild implements IProjectModulesManager {
private static final boolean DEBUG_MODULES = false;
//these attributes must be set whenever this class is restored.
private volatile IProject project;
private volatile IPythonNature nature;
public ProjectModulesManager() {
}
/**
* @see org.python.pydev.core.IProjectModulesManager#setProject(org.eclipse.core.resources.IProject, boolean)
*/
@Override
public void setProject(IProject project, IPythonNature nature, boolean restoreDeltas) {
this.project = project;
this.nature = nature;
File completionsCacheDir = this.nature.getCompletionsCacheDir();
if (completionsCacheDir == null) {
return; //project was deleted.
}
DeltaSaver<ModulesKey> d = this.deltaSaver = new DeltaSaver<ModulesKey>(completionsCacheDir, "v1_astdelta",
readFromFileMethod,
toFileMethod);
if (!restoreDeltas) {
d.clearAll(); //remove any existing deltas
} else {
d.processDeltas(this); //process the current deltas (clears current deltas automatically and saves it when the processing is concluded)
}
}
// ------------------------ delta processing
/**
* @see org.python.pydev.core.IProjectModulesManager#endProcessing()
*/
@Override
public void endProcessing() {
//save it with the updated info
nature.saveAstManager();
}
// ------------------------ end delta processing
/**
* @see org.python.pydev.core.IProjectModulesManager#setPythonNature(org.python.pydev.core.IPythonNature)
*/
@Override
public void setPythonNature(IPythonNature nature) {
this.nature = nature;
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getNature()
*/
@Override
public IPythonNature getNature() {
return nature;
}
/**
* @param defaultSelectedInterpreter
* @see org.python.pydev.core.IProjectModulesManager#getSystemModulesManager()
*/
@Override
public ISystemModulesManager getSystemModulesManager() {
if (nature == null) {
Log.log("Nature still not set");
return null; //still not set (initialization)
}
try {
return nature.getProjectInterpreter().getModulesManager();
} catch (Exception e1) {
return null;
}
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getAllModuleNames(boolean addDependencies, String partStartingWithLowerCase)
*/
@Override
public Set<String> getAllModuleNames(boolean addDependencies, String partStartingWithLowerCase) {
if (addDependencies) {
Set<String> s = new HashSet<String>();
IModulesManager[] managersInvolved = this.getManagersInvolved(true);
for (int i = 0; i < managersInvolved.length; i++) {
s.addAll(managersInvolved[i].getAllModuleNames(false, partStartingWithLowerCase));
}
return s;
} else {
return super.getAllModuleNames(addDependencies, partStartingWithLowerCase);
}
}
/**
* @return all the modules that start with some token (from this manager and others involved)
*/
@Override
public SortedMap<ModulesKey, ModulesKey> getAllModulesStartingWith(String strStartingWith) {
SortedMap<ModulesKey, ModulesKey> ret = new TreeMap<ModulesKey, ModulesKey>();
IModulesManager[] managersInvolved = this.getManagersInvolved(true);
for (int i = 0; i < managersInvolved.length; i++) {
ret.putAll(managersInvolved[i].getAllDirectModulesStartingWith(strStartingWith));
}
return ret;
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getModule(java.lang.String, org.python.pydev.plugin.nature.PythonNature, boolean)
*/
@Override
public IModule getModule(String name, IPythonNature nature, boolean dontSearchInit) {
return getModule(name, nature, true, dontSearchInit);
}
/**
* When looking for relative, we do not check dependencies
*/
@Override
public IModule getRelativeModule(String name, IPythonNature nature) {
return super.getModule(false, name, nature, true); //cannot be a compiled module
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getModule(java.lang.String, org.python.pydev.plugin.nature.PythonNature, boolean, boolean)
*/
@Override
public IModule getModule(String name, IPythonNature nature, boolean checkSystemManager, boolean dontSearchInit) {
Tuple<IModule, IModulesManager> ret = getModuleAndRelatedModulesManager(name, nature, checkSystemManager,
dontSearchInit);
if (ret != null) {
return ret.o1;
}
return null;
}
/**
* @return a tuple with the IModule requested and the IModulesManager that contained that module.
*/
@Override
public Tuple<IModule, IModulesManager> getModuleAndRelatedModulesManager(String name, IPythonNature nature,
boolean checkSystemManager, boolean dontSearchInit) {
IModule module = null;
IModulesManager[] managersInvolved = this.getManagersInvolved(true); //only get the system manager here (to avoid recursion)
for (IModulesManager m : managersInvolved) {
if (m instanceof ISystemModulesManager) {
module = ((ISystemModulesManager) m).getBuiltinModule(name, dontSearchInit);
if (module != null) {
if (DEBUG_MODULES) {
System.out.println("Trying to get:" + name + " - " + " returned builtin:" + module + " - "
+ m.getClass());
}
return new Tuple<IModule, IModulesManager>(module, m);
}
}
}
for (IModulesManager m : managersInvolved) {
if (m instanceof IProjectModulesManager) {
IProjectModulesManager pM = (IProjectModulesManager) m;
module = pM.getModuleInDirectManager(name, nature, dontSearchInit);
} else if (m instanceof ISystemModulesManager) {
ISystemModulesManager systemModulesManager = (ISystemModulesManager) m;
module = systemModulesManager.getModuleWithoutBuiltins(name, nature, dontSearchInit);
} else {
throw new RuntimeException("Unexpected: " + m);
}
if (module != null) {
if (DEBUG_MODULES) {
System.out.println("Trying to get:" + name + " - " + " returned:" + module + " - " + m.getClass());
}
return new Tuple<IModule, IModulesManager>(module, m);
}
}
if (DEBUG_MODULES) {
System.out.println("Trying to get:" + name + " - " + " returned:null - " + this.getClass());
}
return null;
}
/**
* Only searches the modules contained in the direct modules manager.
*/
@Override
public IModule getModuleInDirectManager(String name, IPythonNature nature, boolean dontSearchInit) {
return super.getModule(name, nature, dontSearchInit);
}
@Override
protected String getResolveModuleErr(IResource member) {
return "Unable to find the path " + member + " in the project were it\n"
+ "is added as a source folder for pydev (project: " + project.getName() + ")";
}
public String resolveModuleOnlyInProjectSources(String fileAbsolutePath, boolean addExternal) throws CoreException {
String onlyProjectPythonPathStr = this.nature.getPythonPathNature().getOnlyProjectPythonPathStr(addExternal);
List<String> pathItems = StringUtils.splitAndRemoveEmptyTrimmed(onlyProjectPythonPathStr, '|');
List<String> filteredPathItems = filterDuplicatesPreservingOrder(pathItems);
return this.pythonPathHelper.resolveModule(fileAbsolutePath, false, filteredPathItems, project);
}
private List<String> filterDuplicatesPreservingOrder(List<String> pathItems) {
return new ArrayList<>(new LinkedHashSet<>(pathItems));
}
/**
* @see org.python.pydev.core.IProjectModulesManager#resolveModule(java.lang.String)
*/
@Override
public String resolveModule(String full) {
return resolveModule(full, true);
}
/**
* @see org.python.pydev.core.IProjectModulesManager#resolveModule(java.lang.String, boolean)
*/
@Override
public String resolveModule(String full, boolean checkSystemManager) {
IModulesManager[] managersInvolved = this.getManagersInvolved(checkSystemManager);
for (IModulesManager m : managersInvolved) {
String mod;
if (m instanceof IProjectModulesManager) {
IProjectModulesManager pM = (IProjectModulesManager) m;
mod = pM.resolveModuleInDirectManager(full);
} else {
mod = m.resolveModule(full);
}
if (mod != null) {
return mod;
}
}
return null;
}
@Override
public String resolveModuleInDirectManager(String full) {
if (nature != null) {
return pythonPathHelper.resolveModule(full, false, nature.getProject());
}
return super.resolveModule(full);
}
@Override
public String resolveModuleInDirectManager(IFile member) {
File inOs = member.getRawLocation().toFile();
return resolveModuleInDirectManager(FileUtils.getFileAbsolutePath(inOs));
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getSize(boolean)
*/
@Override
public int getSize(boolean addDependenciesSize) {
if (addDependenciesSize) {
int size = 0;
IModulesManager[] managersInvolved = this.getManagersInvolved(true);
for (int i = 0; i < managersInvolved.length; i++) {
size += managersInvolved[i].getSize(false);
}
return size;
} else {
return super.getSize(addDependenciesSize);
}
}
/**
* @see org.python.pydev.core.IProjectModulesManager#getBuiltins()
*/
@Override
public String[] getBuiltins() {
String[] builtins = null;
ISystemModulesManager systemModulesManager = getSystemModulesManager();
if (systemModulesManager != null) {
builtins = systemModulesManager.getBuiltins();
}
return builtins;
}
/**
* @param checkSystemManager whether the system manager should be added
* @param referenced true if we should get the referenced projects
* false if we should get the referencing projects
* @return the Managers that this project references or the ones that reference this project (depends on 'referenced')
*
* Change in 1.3.3: adds itself to the list of returned managers
*/
private synchronized IModulesManager[] getManagers(boolean checkSystemManager, boolean referenced) {
CompletionCache localCompletionCache = this.completionCache;
if (localCompletionCache != null) {
IModulesManager[] ret = localCompletionCache.getManagers(referenced);
if (ret != null) {
return ret;
}
}
ArrayList<IModulesManager> list = new ArrayList<IModulesManager>();
ISystemModulesManager systemModulesManager = getSystemModulesManager();
//add itself 1st
list.add(this);
//get the projects 1st
if (project != null) {
IModulesManager javaModulesManagerForProject = JavaProjectModulesManagerCreator
.createJavaProjectModulesManagerIfPossible(project);
if (javaModulesManagerForProject != null) {
list.add(javaModulesManagerForProject);
}
Set<IProject> projs;
if (referenced) {
projs = getReferencedProjects(project);
} else {
projs = getReferencingProjects(project);
}
addModuleManagers(list, projs);
}
//the system is the last one we add
//http://sourceforge.net/tracker/index.php?func=detail&aid=1687018&group_id=85796&atid=577329
if (checkSystemManager && systemModulesManager != null) {
//may be null in initialization or if the project does not have a related interpreter manager at the present time
//(i.e.: misconfigured project)
list.add(systemModulesManager);
}
IModulesManager[] ret = list.toArray(new IModulesManager[list.size()]);
if (localCompletionCache != null) {
localCompletionCache.setManagers(ret, referenced);
}
return ret;
}
public static Set<IProject> getReferencingProjects(IProject project) {
HashSet<IProject> memo = new HashSet<IProject>();
getProjectsRecursively(project, false, memo);
memo.remove(project); //shouldn't happen unless we've a cycle...
return memo;
}
public static Set<IProject> getReferencedProjects(IProject project) {
HashSet<IProject> memo = new HashSet<IProject>();
getProjectsRecursively(project, true, memo);
memo.remove(project); //shouldn't happen unless we've a cycle...
return memo;
}
/**
* @param project the project for which we want references.
* @param referenced whether we want to get the referenced projects or the ones referencing this one.
* @param memo (out) this is the place where all the projects will e available.
*
* Note: the project itself will not be added.
*/
private static void getProjectsRecursively(IProject project, boolean referenced, HashSet<IProject> memo) {
IProject[] projects = null;
try {
if (project == null || !project.isOpen() || !project.exists() || memo.contains(projects)) {
return;
}
if (referenced) {
projects = project.getReferencedProjects();
} else {
projects = project.getReferencingProjects();
}
} catch (CoreException e) {
//ignore (it's closed)
}
if (projects != null) {
for (IProject p : projects) {
if (!memo.contains(p)) {
memo.add(p);
getProjectsRecursively(p, referenced, memo);
}
}
}
}
/**
* @param list the list that will be filled with the managers
* @param projects the projects that should have the managers added
*/
private void addModuleManagers(ArrayList<IModulesManager> list, Collection<IProject> projects) {
for (IProject project : projects) {
PythonNature nature = PythonNature.getPythonNature(project);
if (nature != null) {
ICodeCompletionASTManager otherProjectAstManager = nature.getAstManager();
if (otherProjectAstManager != null) {
IModulesManager projectModulesManager = otherProjectAstManager.getModulesManager();
if (projectModulesManager != null) {
list.add(projectModulesManager);
}
} else {
//Removed the warning below: this may be common when starting up...
//String msg = "No ast manager configured for :" + project.getName();
//Log.log(IStatus.WARNING, msg, new RuntimeException(msg));
}
}
IModulesManager javaModulesManagerForProject = JavaProjectModulesManagerCreator
.createJavaProjectModulesManagerIfPossible(project);
if (javaModulesManagerForProject != null) {
list.add(javaModulesManagerForProject);
}
}
}
/**
* @return Returns the managers that this project references, including itself.
*/
public IModulesManager[] getManagersInvolved(boolean checkSystemManager) {
return getManagers(checkSystemManager, true);
}
/**
* @return Returns the managers that reference this project, including itself.
*/
public IModulesManager[] getRefencingManagersInvolved(boolean checkSystemManager) {
return getManagers(checkSystemManager, false);
}
/**
* Helper to work as a timer to know when to check for pythonpath consistencies.
*/
private volatile long checkedPythonpathConsistency = 0;
/**
* @see org.python.pydev.core.IProjectModulesManager#getCompletePythonPath()
*/
@Override
public List<String> getCompletePythonPath(IInterpreterInfo interpreter, IInterpreterManager manager) {
List<String> l = new ArrayList<String>();
IModulesManager[] managersInvolved = getManagersInvolved(true);
for (IModulesManager m : managersInvolved) {
if (m instanceof ISystemModulesManager) {
ISystemModulesManager systemModulesManager = (ISystemModulesManager) m;
l.addAll(systemModulesManager.getCompletePythonPath(interpreter, manager));
} else {
PythonPathHelper h = (PythonPathHelper) m.getPythonPathHelper();
if (h != null) {
List<String> pythonpath = h.getPythonpath();
//Note: this was previously only l.addAll(pythonpath), and was changed to the code below as a place
//to check for consistencies in the pythonpath stored in the pythonpath helper and the pythonpath
//available in the PythonPathNature (in general, when requesting it the PythonPathHelper should be
//used, as it's a cache for the resolved values of the PythonPathNature).
boolean forceCheck = false;
ProjectModulesManager m2 = null;
String onlyProjectPythonPathStr = null;
if (m instanceof ProjectModulesManager) {
long currentTimeMillis = System.currentTimeMillis();
m2 = (ProjectModulesManager) m;
//check at most once every 20 seconds (or every time if the pythonpath is empty... in which case
//it should be fast to get it too if it's consistent).
if (pythonpath.size() == 0 || currentTimeMillis - m2.checkedPythonpathConsistency > 20 * 1000) {
try {
IPythonNature n = m.getNature();
if (n != null) {
IPythonPathNature pythonPathNature = n.getPythonPathNature();
if (pythonPathNature != null) {
onlyProjectPythonPathStr = pythonPathNature.getOnlyProjectPythonPathStr(true);
m2.checkedPythonpathConsistency = currentTimeMillis;
forceCheck = true;
}
}
} catch (Exception e) {
Log.log(e);
}
}
}
if (forceCheck) {
//Check if it's actually correct and auto-fix if it's not.
List<String> parsed = PythonPathHelper.parsePythonPathFromStr(onlyProjectPythonPathStr, null);
if (m2.nature != null && !new HashSet<String>(parsed).equals(new HashSet<String>(pythonpath))) {
// Make it right at this moment (so any other place that calls it before the restore
//takes place has the proper version).
h.setPythonPath(parsed);
// Force a rebuild as the PythonPathHelper paths are not up to date.
m2.nature.rebuildPath();
}
l.addAll(parsed); //add the proper paths
} else {
l.addAll(pythonpath);
}
}
}
}
return l;
}
}
| bobwalker99/Pydev | plugins/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/ProjectModulesManager.java | Java | epl-1.0 | 22,376 | 39.317117 | 147 | 0.618565 | false |
/**
*
*/
package com.coin.arbitrage.huobi.util;
/**
* @author Frank
*
*/
public enum DepthType {
STEP0("step0"),
STEP1("step1"),
STEP2("step2"),
STEP3("step3"),
STEP4("step4"),
STEP5("step5");
private String depth;
private DepthType(String depth) {
this.depth = depth;
}
public String getDepth() {
return depth;
}
}
| zzzzwwww12/BuyLowSellHigh | BuyLowSellHigh/src/main/java/com/coin/arbitrage/huobi/util/DepthType.java | Java | epl-1.0 | 375 | 11.392857 | 38 | 0.565333 | false |
/*******************************************************************************
* Debrief - the Open Source Maritime Analysis Application
* http://debrief.info
*
* (C) 2000-2020, Deep Blue C Technology Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html)
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*******************************************************************************/
package Debrief.Tools.Tote;
import MWC.GUI.PlainChart;
import MWC.GUI.ToolParent;
import MWC.GUI.Tools.Action;
import MWC.GUI.Tools.PlainTool;
public final class StartTote extends PlainTool {
/**
*
*/
private static final long serialVersionUID = 1L;
/////////////////////////////////////////////////////////////
// member variables
////////////////////////////////////////////////////////////
private final PlainChart _theChart;
/////////////////////////////////////////////////////////////
// constructor
////////////////////////////////////////////////////////////
public StartTote(final ToolParent theParent, final PlainChart theChart) {
super(theParent, "Step Forward", null);
_theChart = theChart;
}
@Override
public final void execute() {
_theChart.update();
}
/////////////////////////////////////////////////////////////
// member functions
////////////////////////////////////////////////////////////
@Override
public final Action getData() {
// return the product
return null;
}
}
| debrief/debrief | org.mwc.debrief.legacy/src/Debrief/Tools/Tote/StartTote.java | Java | epl-1.0 | 1,752 | 29.285714 | 81 | 0.484589 | false |
/**
*/
package org.liquibase.xml.ns.dbchangelog.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.liquibase.xml.ns.dbchangelog.AndType;
import org.liquibase.xml.ns.dbchangelog.ChangeLogPropertyDefinedType;
import org.liquibase.xml.ns.dbchangelog.ChangeSetExecutedType;
import org.liquibase.xml.ns.dbchangelog.ColumnExistsType;
import org.liquibase.xml.ns.dbchangelog.CustomPreconditionType;
import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage;
import org.liquibase.xml.ns.dbchangelog.DbmsType;
import org.liquibase.xml.ns.dbchangelog.ExpectedQuotingStrategyType;
import org.liquibase.xml.ns.dbchangelog.ForeignKeyConstraintExistsType;
import org.liquibase.xml.ns.dbchangelog.IndexExistsType;
import org.liquibase.xml.ns.dbchangelog.NotType;
import org.liquibase.xml.ns.dbchangelog.OrType;
import org.liquibase.xml.ns.dbchangelog.PrimaryKeyExistsType;
import org.liquibase.xml.ns.dbchangelog.RowCountType;
import org.liquibase.xml.ns.dbchangelog.RunningAsType;
import org.liquibase.xml.ns.dbchangelog.SequenceExistsType;
import org.liquibase.xml.ns.dbchangelog.SqlCheckType;
import org.liquibase.xml.ns.dbchangelog.TableExistsType;
import org.liquibase.xml.ns.dbchangelog.TableIsEmptyType;
import org.liquibase.xml.ns.dbchangelog.ViewExistsType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>And Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getGroup <em>Group</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getAnd <em>And</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getOr <em>Or</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getNot <em>Not</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getDbms <em>Dbms</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getRunningAs <em>Running As</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getChangeSetExecuted <em>Change Set Executed</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getTableExists <em>Table Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getColumnExists <em>Column Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getSequenceExists <em>Sequence Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getForeignKeyConstraintExists <em>Foreign Key Constraint Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getIndexExists <em>Index Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getPrimaryKeyExists <em>Primary Key Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getViewExists <em>View Exists</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getTableIsEmpty <em>Table Is Empty</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getRowCount <em>Row Count</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getSqlCheck <em>Sql Check</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getChangeLogPropertyDefined <em>Change Log Property Defined</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getExpectedQuotingStrategy <em>Expected Quoting Strategy</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getCustomPrecondition <em>Custom Precondition</em>}</li>
* <li>{@link org.liquibase.xml.ns.dbchangelog.impl.AndTypeImpl#getAny <em>Any</em>}</li>
* </ul>
*
* @generated
*/
public class AndTypeImpl extends MinimalEObjectImpl.Container implements AndType {
/**
* The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGroup()
* @generated
* @ordered
*/
protected FeatureMap group;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AndTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DbchangelogPackage.eINSTANCE.getAndType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getGroup() {
if (group == null) {
group = new BasicFeatureMap(this, DbchangelogPackage.AND_TYPE__GROUP);
}
return group;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<AndType> getAnd() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_And());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<OrType> getOr() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_Or());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<NotType> getNot() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_Not());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DbmsType> getDbms() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_Dbms());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<RunningAsType> getRunningAs() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_RunningAs());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ChangeSetExecutedType> getChangeSetExecuted() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ChangeSetExecuted());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<TableExistsType> getTableExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_TableExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ColumnExistsType> getColumnExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ColumnExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<SequenceExistsType> getSequenceExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_SequenceExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ForeignKeyConstraintExistsType> getForeignKeyConstraintExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ForeignKeyConstraintExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<IndexExistsType> getIndexExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_IndexExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<PrimaryKeyExistsType> getPrimaryKeyExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_PrimaryKeyExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ViewExistsType> getViewExists() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ViewExists());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<TableIsEmptyType> getTableIsEmpty() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_TableIsEmpty());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<RowCountType> getRowCount() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_RowCount());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<SqlCheckType> getSqlCheck() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_SqlCheck());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ChangeLogPropertyDefinedType> getChangeLogPropertyDefined() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ChangeLogPropertyDefined());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ExpectedQuotingStrategyType> getExpectedQuotingStrategy() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_ExpectedQuotingStrategy());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<CustomPreconditionType> getCustomPrecondition() {
return getGroup().list(DbchangelogPackage.eINSTANCE.getAndType_CustomPrecondition());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureMap getAny() {
return (FeatureMap)getGroup().<FeatureMap.Entry>list(DbchangelogPackage.eINSTANCE.getAndType_Any());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DbchangelogPackage.AND_TYPE__GROUP:
return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__AND:
return ((InternalEList<?>)getAnd()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__OR:
return ((InternalEList<?>)getOr()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__NOT:
return ((InternalEList<?>)getNot()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__DBMS:
return ((InternalEList<?>)getDbms()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__RUNNING_AS:
return ((InternalEList<?>)getRunningAs()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__CHANGE_SET_EXECUTED:
return ((InternalEList<?>)getChangeSetExecuted()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__TABLE_EXISTS:
return ((InternalEList<?>)getTableExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__COLUMN_EXISTS:
return ((InternalEList<?>)getColumnExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__SEQUENCE_EXISTS:
return ((InternalEList<?>)getSequenceExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__FOREIGN_KEY_CONSTRAINT_EXISTS:
return ((InternalEList<?>)getForeignKeyConstraintExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__INDEX_EXISTS:
return ((InternalEList<?>)getIndexExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__PRIMARY_KEY_EXISTS:
return ((InternalEList<?>)getPrimaryKeyExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__VIEW_EXISTS:
return ((InternalEList<?>)getViewExists()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__TABLE_IS_EMPTY:
return ((InternalEList<?>)getTableIsEmpty()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__ROW_COUNT:
return ((InternalEList<?>)getRowCount()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__SQL_CHECK:
return ((InternalEList<?>)getSqlCheck()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__CHANGE_LOG_PROPERTY_DEFINED:
return ((InternalEList<?>)getChangeLogPropertyDefined()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__EXPECTED_QUOTING_STRATEGY:
return ((InternalEList<?>)getExpectedQuotingStrategy()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__CUSTOM_PRECONDITION:
return ((InternalEList<?>)getCustomPrecondition()).basicRemove(otherEnd, msgs);
case DbchangelogPackage.AND_TYPE__ANY:
return ((InternalEList<?>)getAny()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DbchangelogPackage.AND_TYPE__GROUP:
if (coreType) return getGroup();
return ((FeatureMap.Internal)getGroup()).getWrapper();
case DbchangelogPackage.AND_TYPE__AND:
return getAnd();
case DbchangelogPackage.AND_TYPE__OR:
return getOr();
case DbchangelogPackage.AND_TYPE__NOT:
return getNot();
case DbchangelogPackage.AND_TYPE__DBMS:
return getDbms();
case DbchangelogPackage.AND_TYPE__RUNNING_AS:
return getRunningAs();
case DbchangelogPackage.AND_TYPE__CHANGE_SET_EXECUTED:
return getChangeSetExecuted();
case DbchangelogPackage.AND_TYPE__TABLE_EXISTS:
return getTableExists();
case DbchangelogPackage.AND_TYPE__COLUMN_EXISTS:
return getColumnExists();
case DbchangelogPackage.AND_TYPE__SEQUENCE_EXISTS:
return getSequenceExists();
case DbchangelogPackage.AND_TYPE__FOREIGN_KEY_CONSTRAINT_EXISTS:
return getForeignKeyConstraintExists();
case DbchangelogPackage.AND_TYPE__INDEX_EXISTS:
return getIndexExists();
case DbchangelogPackage.AND_TYPE__PRIMARY_KEY_EXISTS:
return getPrimaryKeyExists();
case DbchangelogPackage.AND_TYPE__VIEW_EXISTS:
return getViewExists();
case DbchangelogPackage.AND_TYPE__TABLE_IS_EMPTY:
return getTableIsEmpty();
case DbchangelogPackage.AND_TYPE__ROW_COUNT:
return getRowCount();
case DbchangelogPackage.AND_TYPE__SQL_CHECK:
return getSqlCheck();
case DbchangelogPackage.AND_TYPE__CHANGE_LOG_PROPERTY_DEFINED:
return getChangeLogPropertyDefined();
case DbchangelogPackage.AND_TYPE__EXPECTED_QUOTING_STRATEGY:
return getExpectedQuotingStrategy();
case DbchangelogPackage.AND_TYPE__CUSTOM_PRECONDITION:
return getCustomPrecondition();
case DbchangelogPackage.AND_TYPE__ANY:
if (coreType) return getAny();
return ((FeatureMap.Internal)getAny()).getWrapper();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DbchangelogPackage.AND_TYPE__GROUP:
((FeatureMap.Internal)getGroup()).set(newValue);
return;
case DbchangelogPackage.AND_TYPE__AND:
getAnd().clear();
getAnd().addAll((Collection<? extends AndType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__OR:
getOr().clear();
getOr().addAll((Collection<? extends OrType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__NOT:
getNot().clear();
getNot().addAll((Collection<? extends NotType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__DBMS:
getDbms().clear();
getDbms().addAll((Collection<? extends DbmsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__RUNNING_AS:
getRunningAs().clear();
getRunningAs().addAll((Collection<? extends RunningAsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__CHANGE_SET_EXECUTED:
getChangeSetExecuted().clear();
getChangeSetExecuted().addAll((Collection<? extends ChangeSetExecutedType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__TABLE_EXISTS:
getTableExists().clear();
getTableExists().addAll((Collection<? extends TableExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__COLUMN_EXISTS:
getColumnExists().clear();
getColumnExists().addAll((Collection<? extends ColumnExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__SEQUENCE_EXISTS:
getSequenceExists().clear();
getSequenceExists().addAll((Collection<? extends SequenceExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__FOREIGN_KEY_CONSTRAINT_EXISTS:
getForeignKeyConstraintExists().clear();
getForeignKeyConstraintExists().addAll((Collection<? extends ForeignKeyConstraintExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__INDEX_EXISTS:
getIndexExists().clear();
getIndexExists().addAll((Collection<? extends IndexExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__PRIMARY_KEY_EXISTS:
getPrimaryKeyExists().clear();
getPrimaryKeyExists().addAll((Collection<? extends PrimaryKeyExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__VIEW_EXISTS:
getViewExists().clear();
getViewExists().addAll((Collection<? extends ViewExistsType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__TABLE_IS_EMPTY:
getTableIsEmpty().clear();
getTableIsEmpty().addAll((Collection<? extends TableIsEmptyType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__ROW_COUNT:
getRowCount().clear();
getRowCount().addAll((Collection<? extends RowCountType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__SQL_CHECK:
getSqlCheck().clear();
getSqlCheck().addAll((Collection<? extends SqlCheckType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__CHANGE_LOG_PROPERTY_DEFINED:
getChangeLogPropertyDefined().clear();
getChangeLogPropertyDefined().addAll((Collection<? extends ChangeLogPropertyDefinedType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__EXPECTED_QUOTING_STRATEGY:
getExpectedQuotingStrategy().clear();
getExpectedQuotingStrategy().addAll((Collection<? extends ExpectedQuotingStrategyType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__CUSTOM_PRECONDITION:
getCustomPrecondition().clear();
getCustomPrecondition().addAll((Collection<? extends CustomPreconditionType>)newValue);
return;
case DbchangelogPackage.AND_TYPE__ANY:
((FeatureMap.Internal)getAny()).set(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DbchangelogPackage.AND_TYPE__GROUP:
getGroup().clear();
return;
case DbchangelogPackage.AND_TYPE__AND:
getAnd().clear();
return;
case DbchangelogPackage.AND_TYPE__OR:
getOr().clear();
return;
case DbchangelogPackage.AND_TYPE__NOT:
getNot().clear();
return;
case DbchangelogPackage.AND_TYPE__DBMS:
getDbms().clear();
return;
case DbchangelogPackage.AND_TYPE__RUNNING_AS:
getRunningAs().clear();
return;
case DbchangelogPackage.AND_TYPE__CHANGE_SET_EXECUTED:
getChangeSetExecuted().clear();
return;
case DbchangelogPackage.AND_TYPE__TABLE_EXISTS:
getTableExists().clear();
return;
case DbchangelogPackage.AND_TYPE__COLUMN_EXISTS:
getColumnExists().clear();
return;
case DbchangelogPackage.AND_TYPE__SEQUENCE_EXISTS:
getSequenceExists().clear();
return;
case DbchangelogPackage.AND_TYPE__FOREIGN_KEY_CONSTRAINT_EXISTS:
getForeignKeyConstraintExists().clear();
return;
case DbchangelogPackage.AND_TYPE__INDEX_EXISTS:
getIndexExists().clear();
return;
case DbchangelogPackage.AND_TYPE__PRIMARY_KEY_EXISTS:
getPrimaryKeyExists().clear();
return;
case DbchangelogPackage.AND_TYPE__VIEW_EXISTS:
getViewExists().clear();
return;
case DbchangelogPackage.AND_TYPE__TABLE_IS_EMPTY:
getTableIsEmpty().clear();
return;
case DbchangelogPackage.AND_TYPE__ROW_COUNT:
getRowCount().clear();
return;
case DbchangelogPackage.AND_TYPE__SQL_CHECK:
getSqlCheck().clear();
return;
case DbchangelogPackage.AND_TYPE__CHANGE_LOG_PROPERTY_DEFINED:
getChangeLogPropertyDefined().clear();
return;
case DbchangelogPackage.AND_TYPE__EXPECTED_QUOTING_STRATEGY:
getExpectedQuotingStrategy().clear();
return;
case DbchangelogPackage.AND_TYPE__CUSTOM_PRECONDITION:
getCustomPrecondition().clear();
return;
case DbchangelogPackage.AND_TYPE__ANY:
getAny().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DbchangelogPackage.AND_TYPE__GROUP:
return group != null && !group.isEmpty();
case DbchangelogPackage.AND_TYPE__AND:
return !getAnd().isEmpty();
case DbchangelogPackage.AND_TYPE__OR:
return !getOr().isEmpty();
case DbchangelogPackage.AND_TYPE__NOT:
return !getNot().isEmpty();
case DbchangelogPackage.AND_TYPE__DBMS:
return !getDbms().isEmpty();
case DbchangelogPackage.AND_TYPE__RUNNING_AS:
return !getRunningAs().isEmpty();
case DbchangelogPackage.AND_TYPE__CHANGE_SET_EXECUTED:
return !getChangeSetExecuted().isEmpty();
case DbchangelogPackage.AND_TYPE__TABLE_EXISTS:
return !getTableExists().isEmpty();
case DbchangelogPackage.AND_TYPE__COLUMN_EXISTS:
return !getColumnExists().isEmpty();
case DbchangelogPackage.AND_TYPE__SEQUENCE_EXISTS:
return !getSequenceExists().isEmpty();
case DbchangelogPackage.AND_TYPE__FOREIGN_KEY_CONSTRAINT_EXISTS:
return !getForeignKeyConstraintExists().isEmpty();
case DbchangelogPackage.AND_TYPE__INDEX_EXISTS:
return !getIndexExists().isEmpty();
case DbchangelogPackage.AND_TYPE__PRIMARY_KEY_EXISTS:
return !getPrimaryKeyExists().isEmpty();
case DbchangelogPackage.AND_TYPE__VIEW_EXISTS:
return !getViewExists().isEmpty();
case DbchangelogPackage.AND_TYPE__TABLE_IS_EMPTY:
return !getTableIsEmpty().isEmpty();
case DbchangelogPackage.AND_TYPE__ROW_COUNT:
return !getRowCount().isEmpty();
case DbchangelogPackage.AND_TYPE__SQL_CHECK:
return !getSqlCheck().isEmpty();
case DbchangelogPackage.AND_TYPE__CHANGE_LOG_PROPERTY_DEFINED:
return !getChangeLogPropertyDefined().isEmpty();
case DbchangelogPackage.AND_TYPE__EXPECTED_QUOTING_STRATEGY:
return !getExpectedQuotingStrategy().isEmpty();
case DbchangelogPackage.AND_TYPE__CUSTOM_PRECONDITION:
return !getCustomPrecondition().isEmpty();
case DbchangelogPackage.AND_TYPE__ANY:
return !getAny().isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (group: ");
result.append(group);
result.append(')');
return result.toString();
}
} //AndTypeImpl
| Treehopper/EclipseAugments | liquibase-editor/eu.hohenegger.xsd.liquibase/src-gen/org/liquibase/xml/ns/dbchangelog/impl/AndTypeImpl.java | Java | epl-1.0 | 23,515 | 34.400929 | 140 | 0.691006 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="cxxStruct" />
<meta name="DC.Title" content="TAlfLCTTextVisualSetTextPaneParams" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-D60576CC-F39F-396B-8DF9-874FDA1D6D4B" />
<title>
TAlfLCTTextVisualSetTextPaneParams
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api" />
<link rel="stylesheet" type="text/css" href="cxxref.css" />
</head>
<body class="cxxref" id="GUID-D60576CC-F39F-396B-8DF9-874FDA1D6D4B">
<a name="GUID-D60576CC-F39F-396B-8DF9-874FDA1D6D4B">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2518338 id2518347 id2420140 id1202403 id1202408 id2862547 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
</div>
<h1 class="topictitle1">
TAlfLCTTextVisualSetTextPaneParams Struct Reference
</h1>
<table class="signature">
<tr>
<td>
struct TAlfLCTTextVisualSetTextPaneParams
</td>
</tr>
</table>
<div class="section">
</div>
<div class="section member-index">
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Attributes
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-4048A6EC-B36B-38DB-BB31-FD15302523FB">
iApiId
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-FF57C2A4-65C4-3E3C-B1D6-BAEBB914B9DF">
iColumn
</a>
</td>
</tr>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-C1191D36-4D38-3380-A875-B04D454682A1">
iComponentId
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-C834C43E-4E1F-3203-8B1C-E6176D2D382F">
iDrawingOrderIndex
</a>
</td>
</tr>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-16EC4B79-3E60-314E-9777-DC3A2DD6C053">
iOptionIndex
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-D1672301-A371-30BD-A38F-D2EF57D9467C">
iRow
</a>
</td>
</tr>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-5A1D391B-D4B1-3E73-BC38-74A8EEEC030F">
iVarietyIndex
</a>
</td>
</tr>
</tbody>
</table>
</div>
<h1 class="pageHeading topictitle1">
Member Data Documentation
</h1>
<div class="nested1" id="GUID-4048A6EC-B36B-38DB-BB31-FD15302523FB">
<a name="GUID-4048A6EC-B36B-38DB-BB31-FD15302523FB">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iApiId
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iApiId
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-FF57C2A4-65C4-3E3C-B1D6-BAEBB914B9DF">
<a name="GUID-FF57C2A4-65C4-3E3C-B1D6-BAEBB914B9DF">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iColumn
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iColumn
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-C1191D36-4D38-3380-A875-B04D454682A1">
<a name="GUID-C1191D36-4D38-3380-A875-B04D454682A1">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iComponentId
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iComponentId
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-C834C43E-4E1F-3203-8B1C-E6176D2D382F">
<a name="GUID-C834C43E-4E1F-3203-8B1C-E6176D2D382F">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iDrawingOrderIndex
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iDrawingOrderIndex
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-16EC4B79-3E60-314E-9777-DC3A2DD6C053">
<a name="GUID-16EC4B79-3E60-314E-9777-DC3A2DD6C053">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iOptionIndex
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iOptionIndex
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-D1672301-A371-30BD-A38F-D2EF57D9467C">
<a name="GUID-D1672301-A371-30BD-A38F-D2EF57D9467C">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iRow
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iRow
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-5A1D391B-D4B1-3E73-BC38-74A8EEEC030F">
<a name="GUID-5A1D391B-D4B1-3E73-BC38-74A8EEEC030F">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iVarietyIndex
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iVarietyIndex
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-D60576CC-F39F-396B-8DF9-874FDA1D6D4B.html | HTML | epl-1.0 | 8,787 | 25.154762 | 163 | 0.532036 | false |
/*******************************************************************************
* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Denise Smith - 2.4 - February 11, 2013
******************************************************************************/
package org.eclipse.persistence.testing.jaxb.xmlattribute.imports;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases;
import org.eclipse.persistence.testing.jaxb.xmlattribute.imports2.IdentifierType;
public class XmlAttributeImportsTestCases extends JAXBWithJSONTestCases {
private final static String XML_RESOURCE = "org/eclipse/persistence/testing/jaxb/xmlattribute/imports.xml";
private final static String JSON_RESOURCE = "org/eclipse/persistence/testing/jaxb/xmlattribute/imports.json";
private final static String XSD_RESOURCE = "org/eclipse/persistence/testing/jaxb/xmlattribute/imports.xsd";
private final static String XSD_RESOURCE2 = "org/eclipse/persistence/testing/jaxb/xmlattribute/imports2.xsd";
public XmlAttributeImportsTestCases(String name) throws Exception {
super(name);
setControlDocument(XML_RESOURCE);
setControlJSON(JSON_RESOURCE);
setClasses(new Class[]{Person.class});
}
protected Object getControlObject() {
Person obj = new Person();
obj.name = "theName";
obj.setId(IdentifierType.thirdThing);
return obj;
}
public void testSchemaGen() throws Exception{
List<InputStream> controlSchemas = new ArrayList<InputStream>();
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(XSD_RESOURCE);
InputStream is2 = Thread.currentThread().getContextClassLoader().getResourceAsStream(XSD_RESOURCE2);
controlSchemas.add(is);
controlSchemas.add(is2);
super.testSchemaGen(controlSchemas);
}
}
| bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/xmlattribute/imports/XmlAttributeImportsTestCases.java | Java | epl-1.0 | 2,290 | 44.8 | 110 | 0.730568 | false |
/**
* Copyright 2009-2016 Université Paris Ouest and Sorbonne Universités,
Univ. Paris 06 - CNRS UMR 7606 (LIP6)
*
* 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
*
* Project leader / Initial Contributor:
* Lom Messan Hillah - <lom-messan.hillah@lip6.fr>
*
* Contributors:
* ${ocontributors} - <$oemails}>
*
* Mailing list:
* lom-messan.hillah@lip6.fr
*/
/**
* (C) Sorbonne Universités, UPMC Univ Paris 06, UMR CNRS 7606 (LIP6)
* 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:
* Lom HILLAH (LIP6) - Initial models and implementation
* Rachid Alahyane (UPMC) - Infrastructure and continuous integration
* Bastien Bouzerau (UPMC) - Architecture
* Guillaume Giffo (UPMC) - Code generation refactoring, High-level API
*
* $Id ggiffo, Wed Feb 10 15:00:49 CET 2016$
*/
package fr.lip6.move.pnml.ptnet.hlapi;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.List;
import org.apache.axiom.om.OMElement;
import org.eclipse.emf.common.util.DiagnosticChain;
import fr.lip6.move.pnml.framework.hlapi.HLAPIClass;
import fr.lip6.move.pnml.framework.utils.IdRefLinker;
import fr.lip6.move.pnml.framework.utils.ModelRepository;
import fr.lip6.move.pnml.framework.utils.exception.InnerBuildException;
import fr.lip6.move.pnml.framework.utils.exception.InvalidIDException;
import fr.lip6.move.pnml.framework.utils.exception.OtherException;
import fr.lip6.move.pnml.framework.utils.exception.VoidRepositoryException;
import fr.lip6.move.pnml.ptnet.Arc;
import fr.lip6.move.pnml.ptnet.Name;
import fr.lip6.move.pnml.ptnet.NodeGraphics;
import fr.lip6.move.pnml.ptnet.Page;
import fr.lip6.move.pnml.ptnet.PtnetFactory;
import fr.lip6.move.pnml.ptnet.RefTransition;
import fr.lip6.move.pnml.ptnet.ToolInfo;
import fr.lip6.move.pnml.ptnet.Transition;
import fr.lip6.move.pnml.ptnet.impl.PtnetFactoryImpl;
public class TransitionHLAPI implements HLAPIClass,PnObjectHLAPI,NodeHLAPI,TransitionNodeHLAPI{
/**
* The contained LLAPI element.
*/
private Transition item;
/**
* this constructor allows you to set all 'settable' values
* excepted container.
*/
public TransitionHLAPI(
java.lang.String id
, NameHLAPI name
, NodeGraphicsHLAPI nodegraphics
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createTransition();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(name!=null)
item.setName((Name)name.getContainedItem());
if(nodegraphics!=null)
item.setNodegraphics((NodeGraphics)nodegraphics.getContainedItem());
}
/**
* this constructor allows you to set all 'settable' values, including container if any.
*/
public TransitionHLAPI(
java.lang.String id
, NameHLAPI name
, NodeGraphicsHLAPI nodegraphics
, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createTransition();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(name!=null)
item.setName((Name)name.getContainedItem());
if(nodegraphics!=null)
item.setNodegraphics((NodeGraphics)nodegraphics.getContainedItem());
if(containerPage!=null)
item.setContainerPage((Page)containerPage.getContainedItem());
}
/**
* This constructor give access to required stuff only (not container if any)
*/
public TransitionHLAPI(
java.lang.String id
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createTransition();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
}
/**
* This constructor give access to required stuff only (and container)
*/
public TransitionHLAPI(
java.lang.String id
, PageHLAPI containerPage
) throws InvalidIDException ,VoidRepositoryException {//BEGIN CONSTRUCTOR BODY
PtnetFactory fact = PtnetFactoryImpl.eINSTANCE;
synchronized(fact){item = fact.createTransition();}
if(id!=null){
item.setId(ModelRepository.getInstance().getCurrentIdRepository().checkId(id, this));
}
if(containerPage!=null)
item.setContainerPage((Page)containerPage.getContainedItem());
}
/**
* This constructor encapsulate a low level API object in HLAPI.
*/
public TransitionHLAPI(Transition lowLevelAPI){
item = lowLevelAPI;
}
// access to low level API
/**
* Return encapsulated object
*/
public Transition getContainedItem(){
return item;
}
//getters giving LLAPI object
/**
* Return the encapsulate Low Level API object.
*/
public String getId(){
return item.getId();
}
/**
* Return the encapsulate Low Level API object.
*/
public Name getName(){
return item.getName();
}
/**
* Return the encapsulate Low Level API object.
*/
public List<ToolInfo> getToolspecifics(){
return item.getToolspecifics();
}
/**
* Return the encapsulate Low Level API object.
*/
public Page getContainerPage(){
return item.getContainerPage();
}
/**
* Return the encapsulate Low Level API object.
*/
public List<Arc> getInArcs(){
return item.getInArcs();
}
/**
* Return the encapsulate Low Level API object.
*/
public List<Arc> getOutArcs(){
return item.getOutArcs();
}
/**
* Return the encapsulate Low Level API object.
*/
public NodeGraphics getNodegraphics(){
return item.getNodegraphics();
}
/**
* Return the encapsulate Low Level API object.
*/
public List<RefTransition> getReferencingTransitions(){
return item.getReferencingTransitions();
}
//getters giving HLAPI object
/**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
* @return : null if the element is null
*/
public NameHLAPI getNameHLAPI(){
if(item.getName() == null) return null;
return new NameHLAPI(item.getName());
}
/**
* This accessor automatically encapsulate all elements of the selected sublist.
* WARNING : this can creates a lot of new object in memory.
*/
public java.util.List<ToolInfoHLAPI> getToolspecificsHLAPI(){
java.util.List<ToolInfoHLAPI> retour = new ArrayList<ToolInfoHLAPI>();
for (ToolInfo elemnt : getToolspecifics()) {
retour.add(new ToolInfoHLAPI(elemnt));
}
return retour;
}
/**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
* @return : null if the element is null
*/
public PageHLAPI getContainerPageHLAPI(){
if(item.getContainerPage() == null) return null;
return new PageHLAPI(item.getContainerPage());
}
/**
* This accessor automatically encapsulate all elements of the selected sublist.
* WARNING : this can creates a lot of new object in memory.
*/
public java.util.List<ArcHLAPI> getInArcsHLAPI(){
java.util.List<ArcHLAPI> retour = new ArrayList<ArcHLAPI>();
for (Arc elemnt : getInArcs()) {
retour.add(new ArcHLAPI(elemnt));
}
return retour;
}
/**
* This accessor automatically encapsulate all elements of the selected sublist.
* WARNING : this can creates a lot of new object in memory.
*/
public java.util.List<ArcHLAPI> getOutArcsHLAPI(){
java.util.List<ArcHLAPI> retour = new ArrayList<ArcHLAPI>();
for (Arc elemnt : getOutArcs()) {
retour.add(new ArcHLAPI(elemnt));
}
return retour;
}
/**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
* @return : null if the element is null
*/
public NodeGraphicsHLAPI getNodegraphicsHLAPI(){
if(item.getNodegraphics() == null) return null;
return new NodeGraphicsHLAPI(item.getNodegraphics());
}
/**
* This accessor automatically encapsulate all elements of the selected sublist.
* WARNING : this can creates a lot of new object in memory.
*/
public java.util.List<RefTransitionHLAPI> getReferencingTransitionsHLAPI(){
java.util.List<RefTransitionHLAPI> retour = new ArrayList<RefTransitionHLAPI>();
for (RefTransition elemnt : getReferencingTransitions()) {
retour.add(new RefTransitionHLAPI(elemnt));
}
return retour;
}
//Special getter for list of generics object, return only one object type.
//setters (including container setter if aviable)
/**
* set Id
*/
public void setIdHLAPI(
java.lang.String elem) throws InvalidIDException ,VoidRepositoryException {
if(elem!=null){
try{
item.setId(ModelRepository.getInstance().getCurrentIdRepository().changeId(this, elem));
}catch (OtherException e){
ModelRepository.getInstance().getCurrentIdRepository().checkId(elem, this);
}
}
}
/**
* set Name
*/
public void setNameHLAPI(
NameHLAPI elem){
if(elem!=null)
item.setName((Name)elem.getContainedItem());
}
/**
* set Nodegraphics
*/
public void setNodegraphicsHLAPI(
NodeGraphicsHLAPI elem){
if(elem!=null)
item.setNodegraphics((NodeGraphics)elem.getContainedItem());
}
/**
* set ContainerPage
*/
public void setContainerPageHLAPI(
PageHLAPI elem){
if(elem!=null)
item.setContainerPage((Page)elem.getContainedItem());
}
//setters/remover for lists.
public void addToolspecificsHLAPI(ToolInfoHLAPI unit){
item.getToolspecifics().add((ToolInfo)unit.getContainedItem());
}
public void removeToolspecificsHLAPI(ToolInfoHLAPI unit){
item.getToolspecifics().remove((ToolInfo)unit.getContainedItem());
}
//equals method
public boolean equals(TransitionHLAPI item){
return item.getContainedItem().equals(getContainedItem());
}
//PNML
/**
* Returns the PNML xml tree for this object.
*/
public String toPNML(){
return item.toPNML();
}
/**
* Writes the PNML XML tree of this object into file channel.
*/
public void toPNML(FileChannel fc){
item.toPNML(fc);
}
/**
* creates an object from the xml nodes.(symetric work of toPNML)
*/
public void fromPNML(OMElement subRoot,IdRefLinker idr) throws InnerBuildException, InvalidIDException, VoidRepositoryException{
item.fromPNML(subRoot,idr);
}
public boolean validateOCL(DiagnosticChain diagnostics){
return item.validateOCL(diagnostics);
}
} | lhillah/pnmlframework | pnmlFw-PTNet/src/fr/lip6/move/pnml/ptnet/hlapi/TransitionHLAPI.java | Java | epl-1.0 | 11,212 | 21.51004 | 129 | 0.706664 | false |
/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates, Frank Schwarz. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
* 08/20/2008-1.0.1 Nathan Beyer (Cerner)
* - 241308: Primary key is incorrectly assigned to embeddable class
* field with the same name as the primary key field's name
* 01/12/2009-1.1 Daniel Lo, Tom Ware, Guy Pelletier
* - 247041: Null element inserted in the ArrayList
* 07/17/2009 - tware - added tests for DDL generation of maps
* 01/22/2010-2.0.1 Guy Pelletier
* - 294361: incorrect generated table for element collection attribute overrides
* 06/14/2010-2.2 Guy Pelletier
* - 264417: Table generation is incorrect for JoinTables in AssociationOverrides
* 09/15/2010-2.2 Chris Delahunt
* - 322233 - AttributeOverrides and AssociationOverride dont change field type info
* 11/17/2010-2.2.0 Chris Delahunt
* - 214519: Allow appending strings to CREATE TABLE statements
* 11/23/2010-2.2 Frank Schwarz
* - 328774: TABLE_PER_CLASS-mapped key of a java.util.Map does not work for querying
* 01/04/2011-2.3 Guy Pelletier
* - 330628: @PrimaryKeyJoinColumn(...) is not working equivalently to @JoinColumn(..., insertable = false, updatable = false)
* 01/06/2011-2.3 Guy Pelletier
* - 312244: can't map optional one-to-one relationship using @PrimaryKeyJoinColumn
* 01/11/2011-2.3 Guy Pelletier
* - 277079: EmbeddedId's fields are null when using LOB with fetchtype LAZY
******************************************************************************/
package org.eclipse.persistence.testing.tests.jpa.ddlgeneration;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.persistence.testing.framework.junit.JUnitTestCase;
import javax.persistence.EntityManager;
/**
* JUnit test case(s) for DDL generation.
*/
public class DDLTablePerClassTestSuite extends DDLGenerationJUnitTestSuite {
// This is the persistence unit name on server as for persistence unit name "ddlTablePerClass" in J2SE
private static final String DDL_TPC_PU = "MulitPU-2";
public DDLTablePerClassTestSuite() {
super();
}
public DDLTablePerClassTestSuite(String name) {
super(name);
setPuName(DDL_TPC_PU);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.setName("DDLTablePerClassTestSuite");
suite.addTest(new DDLTablePerClassTestSuite("testSetup"));
suite.addTest(new DDLTablePerClassTestSuite("testDDLTablePerClassModel"));
suite.addTest(new DDLTablePerClassTestSuite("testDDLTablePerClassModelQuery"));
if (! JUnitTestCase.isJPA10()) {
suite.addTest(new DDLTablePerClassTestSuite("testTPCMappedKeyMapQuery"));
}
return suite;
}
/**
* The setup is done as a test, both to record its failure, and to allow execution in the server.
*/
public void testSetup() {
// Trigger DDL generation
EntityManager emDDLTPC = createEntityManager("MulitPU-2");
closeEntityManager(emDDLTPC);
clearCache(DDL_TPC_PU);
}
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}
}
| bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/ddlgeneration/DDLTablePerClassTestSuite.java | Java | epl-1.0 | 3,927 | 44.2 | 132 | 0.652406 | false |
/*!
* froala_editor v1.2.7 (http://editor.froala.com)
* License http://editor.froala.com/license
* Copyright 2014-2015 Froala Labs
*/
.dark-theme.froala-box.fr-disabled .froala-element {
color: #999999;
}
.dark-theme.froala-box.fr-disabled button.fr-bttn,
.dark-theme.froala-box.fr-disabled button.fr-trigger {
color: #999999 !important;
}
.dark-theme.froala-box.fr-disabled button.fr-bttn:after,
.dark-theme.froala-box.fr-disabled button.fr-trigger:after {
border-top-color: #999999 !important;
}
.dark-theme.froala-box .html-switch {
border-color: #999999;
}
.dark-theme.froala-box .froala-wrapper.f-basic {
border: solid 1px #252525;
}
.dark-theme.froala-box .froala-wrapper.f-basic.f-placeholder + span.fr-placeholder {
margin: 10px;
}
.dark-theme.froala-box .froala-element hr {
border-top-color: #aaaaaa;
}
.dark-theme.froala-box .froala-element.f-placeholder:before {
color: #aaaaaa;
}
.dark-theme.froala-box .froala-element pre {
border: solid 1px #aaaaaa;
background: #fcfcfc;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.dark-theme.froala-box .froala-element blockquote {
border-left: solid 5px #aaaaaa;
}
.dark-theme.froala-box .froala-element img {
min-width: 32px !important;
min-height: 32px !important;
}
.dark-theme.froala-box .froala-element img.fr-fil {
padding: 10px 10px 10px 3px;
}
.dark-theme.froala-box .froala-element img.fr-fir {
padding: 10px 3px 10px 10px;
}
.dark-theme.froala-box .froala-element img.fr-fin {
padding: 10px 0;
}
.dark-theme.froala-box .froala-element img::selection {
color: #ffffff;
}
.dark-theme.froala-box .froala-element img::-moz-selection {
color: #ffffff;
}
.dark-theme.froala-box .froala-element span.f-img-editor:before {
border: none !important;
outline: solid 1px #2c82c9 !important;
}
.dark-theme.froala-box .froala-element span.f-img-editor.fr-fil {
margin: 10px 10px 10px 3px;
}
.dark-theme.froala-box .froala-element span.f-img-editor.fr-fir {
margin: 10px 3px 10px 10px;
}
.dark-theme.froala-box .froala-element span.f-img-editor.fr-fin {
margin: 10px 0;
}
.dark-theme.froala-box .froala-element span.f-img-handle {
height: 8px;
width: 8px;
border: solid 1px #ffffff !important;
background: #2c82c9;
}
.dark-theme.froala-box .froala-element span.f-video-editor.active:after {
border: solid 1px #252525;
}
.dark-theme.froala-box .froala-element.f-basic {
background: #ffffff;
color: #444444;
padding: 10px;
}
.dark-theme.froala-box .froala-element.f-basic a {
color: inherit;
}
.dark-theme.froala-box .froala-element table td {
border: solid 1px #aaaaaa;
}
.dark-theme.froala-box.f-html .froala-element {
background: #202020;
color: #ffffff;
font-family: 'Courier New', Monospace;
font-size: 13px;
}
.dark-theme.froala-editor {
background: #353535;
border: solid 1px #252525;
border-top: solid 5px #252525;
}
.dark-theme.froala-editor hr {
border-top-color: #aaaaaa;
}
.dark-theme.froala-editor span.f-sep {
border-right: solid 1px #aaaaaa;
height: 35px;
}
.dark-theme.froala-editor button.fr-bttn,
.dark-theme.froala-editor button.fr-trigger {
background: transparent;
color: #ffffff;
font-size: 16px;
line-height: 35px;
width: 40px;
}
.dark-theme.froala-editor button.fr-bttn img,
.dark-theme.froala-editor button.fr-trigger img {
max-width: 40px;
max-height: 35px;
}
.dark-theme.froala-editor button.fr-bttn:disabled,
.dark-theme.froala-editor button.fr-trigger:disabled {
color: #999999 !important;
}
.dark-theme.froala-editor button.fr-bttn:disabled:after,
.dark-theme.froala-editor button.fr-trigger:disabled:after {
border-top-color: #999999 !important;
}
.dark-theme.froala-editor.ie8 button.fr-bttn:hover,
.dark-theme.froala-editor.ie8 button.fr-trigger:hover {
background: #2c82c9;
color: #ffffff;
}
.dark-theme.froala-editor.ie8 button.fr-bttn:hover:after,
.dark-theme.froala-editor.ie8 button.fr-trigger:hover:after {
border-top-color: #ffffff;
}
.dark-theme.froala-editor .bttn-wrapper:not(.touch) button.fr-bttn:hover,
.dark-theme.froala-editor .froala-popup button.fr-bttn:hover,
.dark-theme.froala-editor .bttn-wrapper:not(.touch) button.fr-trigger:hover,
.dark-theme.froala-editor .froala-popup button.fr-trigger:hover {
background: #2c82c9;
color: #ffffff;
}
.dark-theme.froala-editor .bttn-wrapper:not(.touch) button.fr-bttn:hover:after,
.dark-theme.froala-editor .froala-popup button.fr-bttn:hover:after,
.dark-theme.froala-editor .bttn-wrapper:not(.touch) button.fr-trigger:hover:after,
.dark-theme.froala-editor .froala-popup button.fr-trigger:hover:after {
border-top-color: #ffffff;
}
.dark-theme.froala-editor .fr-bttn.active {
color: #2c82c9;
background: transparent;
}
.dark-theme.froala-editor .fr-trigger:after {
border-top-color: #ffffff;
}
.dark-theme.froala-editor .fr-trigger.active {
color: #ffffff;
background: #2c82c9;
}
.dark-theme.froala-editor .fr-trigger.active:after {
border-top-color: #ffffff !important;
}
.dark-theme.froala-editor .fr-dropdown .fr-trigger {
width: calc(40px - 2px);
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu {
background: #353535;
border: solid 1px #252525;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu li.active a {
background: #ffffff !important;
color: #353535 !important;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu li a {
color: #ffffff;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu li a:hover {
background: #ffffff !important;
color: #353535 !important;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li:hover > a,
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li.hover > a {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li > ul {
background: #353535;
color: #ffffff;
border: solid 1px #252525;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li > div {
background: #353535;
color: #ffffff;
border: solid 1px #252525;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li > div > span > span {
border: solid 1px #aaaaaa;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li > div > span:hover > span,
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > li > div > span.hover > span {
background: rgba(61, 142, 185, 0.3);
border: solid 1px #3d8eb9;
}
.dark-theme.froala-editor .fr-dropdown .fr-dropdown-menu.fr-table > hr {
border-top: solid 1px #252525;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu p {
color: #ffffff;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu p a.fr-bttn {
color: #ffffff;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu p a.fr-bttn:hover {
color: #2c82c9;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu .fr-color-bttn.active {
outline: solid 1px #ffffff;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu .fr-color-bttn.active:after {
color: #ffffff;
}
.dark-theme.froala-editor .fr-dropdown.fr-color-picker .fr-dropdown-menu .fr-color-bttn:hover:not(:focus):not(:active) {
outline: solid 1px #ffffff;
}
.dark-theme.froala-editor .froala-popup {
background: #353535;
}
.dark-theme.froala-editor .froala-popup h4 {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup h4 i {
color: #aaaaaa;
}
.dark-theme.froala-editor .froala-popup h4 i.fa-external-link {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup h4 i.fa-external-link:hover {
color: #2c82c9;
}
.dark-theme.froala-editor .froala-popup h4 i:hover {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup button.fr-p-bttn {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup button.fr-p-bttn.f-ok {
background: #2c82c9;
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup button.fr-p-bttn.f-unlink {
background: #b8312f;
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup button.fr-p-bttn.f-unlink:hover {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-editor .froala-popup button.fr-p-bttn:hover,
.dark-theme.froala-editor .froala-popup button.fr-p-bttn:focus {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line.f-popup-toolbar {
background: #353535;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line label {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line input[type="text"] {
border: solid 1px #aaaaaa;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line input[type="text"]:focus {
border: solid 1px #54acd2;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line input[type="text"]:disabled {
background: #ffffff;
color: #999999;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line textarea {
border: solid 1px #aaaaaa;
}
.dark-theme.froala-editor .froala-popup div.f-popup-line textarea:focus {
border: solid 1px #54acd2;
}
.dark-theme.froala-editor .froala-popup.froala-image-editor-popup div.f-popup-line + div.f-popup-line {
border-top: solid 1px #aaaaaa;
}
.dark-theme.froala-editor .froala-popup.froala-video-popup p.or {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line.drop-upload div.f-upload {
color: #ffffff;
border: dashed 2px #aaaaaa;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line.drop-upload div.f-upload:hover {
border: dashed 2px #eeeeee;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line.drop-upload div.f-upload.f-hover {
border: dashed 2px #61bd6d;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line button.f-browse {
background: #475577;
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line button.f-browse:hover {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup div.f-popup-line + div.f-popup-line {
border-top: solid 1px #aaaaaa;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup p.f-progress {
background-color: #61bd6d;
}
.dark-theme.froala-editor .froala-popup.froala-image-popup p.f-progress span {
background-color: #61bd6d;
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line .f-browse-links {
background: #475577;
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line .f-browse-links:hover {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line ul {
background: #353535;
border: solid 1px #252525;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line ul li {
color: #ffffff;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line ul li + li {
border-top: solid 1px #252525;
}
.dark-theme.froala-editor .froala-popup.froala-link-popup div.f-popup-line ul li:hover {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-modal .f-modal-wrapper {
background: #353535;
border: solid 1px #252525;
border-top: solid 5px #252525;
}
.dark-theme.froala-modal .f-modal-wrapper h4 {
color: #ffffff;
}
.dark-theme.froala-modal .f-modal-wrapper h4 i {
color: #aaaaaa;
}
.dark-theme.froala-modal .f-modal-wrapper h4 i:hover {
color: #ffffff;
}
.dark-theme.froala-modal .f-modal-wrapper div.f-image-list div.f-empty {
background: #aaaaaa;
}
.dark-theme.froala-modal .f-modal-wrapper div.f-image-list div .f-delete-img {
background: #b8312f;
color: #ffffff;
}
.dark-theme.froala-modal .f-modal-wrapper div.f-image-list div .f-delete-img:hover {
background: #ffffff;
color: #353535;
}
.dark-theme.froala-modal .f-modal-wrapper div.f-image-list:not(.f-touch) div:hover .f-delete-img:hover {
background: #ffffff;
color: #353535;
}
.froala-overlay {
background: #000000;
}
| bunsha/french | public/admin/assets/froala/css/themes/dark.css | CSS | epl-1.0 | 12,097 | 30.750656 | 120 | 0.723155 | false |
/*******************************************************************************
* Copyright (c) 2000, 2016 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.jface.text.rules;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.BadPositionCategoryException;
import org.eclipse.jface.text.DefaultPositionUpdater;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.DocumentRewriteSession;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.IDocumentPartitionerExtension;
import org.eclipse.jface.text.IDocumentPartitionerExtension2;
import org.eclipse.jface.text.IDocumentPartitionerExtension3;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.jface.text.TypedPosition;
import org.eclipse.jface.text.TypedRegion;
/**
* A standard implementation of a document partitioner. It uses an
* {@link IPartitionTokenScanner} to scan the document and to determine the
* document's partitioning. The tokens returned by the scanner must return the
* partition type as their data. The partitioner remembers the document's
* partitions in the document itself rather than maintaining its own data
* structure.
* <p>
* To reduce array creations in {@link IDocument#getPositions(String)}, the
* positions get cached. The cache is cleared after updating the positions in
* {@link #documentChanged2(DocumentEvent)}. Subclasses need to call
* {@link #clearPositionCache()} after modifying the partitioner's positions.
* The cached positions may be accessed through {@link #getPositions()}.
* </p>
*
* @see IPartitionTokenScanner
* @since 3.1
*/
public class FastPartitioner implements IDocumentPartitioner, IDocumentPartitionerExtension, IDocumentPartitionerExtension2, IDocumentPartitionerExtension3 {
/**
* The position category this partitioner uses to store the document's partitioning information.
*/
private static final String CONTENT_TYPES_CATEGORY= "__content_types_category"; //$NON-NLS-1$
/** The partitioner's scanner */
protected final IPartitionTokenScanner fScanner;
/** The legal content types of this partitioner */
protected final String[] fLegalContentTypes;
/** The partitioner's document */
protected IDocument fDocument;
/** The document length before a document change occurred */
protected int fPreviousDocumentLength;
/** The position updater used to for the default updating of partitions */
protected final DefaultPositionUpdater fPositionUpdater;
/** The offset at which the first changed partition starts */
protected int fStartOffset;
/** The offset at which the last changed partition ends */
protected int fEndOffset;
/**The offset at which a partition has been deleted */
protected int fDeleteOffset;
/**
* The position category this partitioner uses to store the document's partitioning information.
*/
private final String fPositionCategory;
/**
* The active document rewrite session.
*/
private DocumentRewriteSession fActiveRewriteSession;
/**
* Flag indicating whether this partitioner has been initialized.
*/
private boolean fIsInitialized= false;
/**
* The cached positions from our document, so we don't create a new array every time
* someone requests partition information.
*/
private Position[] fCachedPositions= null;
/** Debug option for cache consistency checking. */
private static final boolean CHECK_CACHE_CONSISTENCY= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/FastPartitioner/PositionCache")); //$NON-NLS-1$//$NON-NLS-2$;
/**
* Creates a new partitioner that uses the given scanner and may return
* partitions of the given legal content types.
*
* @param scanner the scanner this partitioner is supposed to use
* @param legalContentTypes the legal content types of this partitioner
*/
public FastPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
fScanner= scanner;
fLegalContentTypes= TextUtilities.copy(legalContentTypes);
fPositionCategory= CONTENT_TYPES_CATEGORY + hashCode();
fPositionUpdater= new DefaultPositionUpdater(fPositionCategory);
}
@Override
public String[] getManagingPositionCategories() {
return new String[] { fPositionCategory };
}
@Override
public final void connect(IDocument document) {
connect(document, false);
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public void connect(IDocument document, boolean delayInitialization) {
Assert.isNotNull(document);
Assert.isTrue(!document.containsPositionCategory(fPositionCategory));
fDocument= document;
fDocument.addPositionCategory(fPositionCategory);
fIsInitialized= false;
if (!delayInitialization)
checkInitialization();
}
/**
* Calls {@link #initialize()} if the receiver is not yet initialized.
*/
protected final void checkInitialization() {
if (!fIsInitialized)
initialize();
}
/**
* Performs the initial partitioning of the partitioner's document.
* <p>
* May be extended by subclasses.
* </p>
*/
protected void initialize() {
fIsInitialized= true;
clearPositionCache();
fScanner.setRange(fDocument, 0, fDocument.getLength());
try {
IToken token= fScanner.nextToken();
while (!token.isEOF()) {
String contentType= getTokenContentType(token);
if (isSupportedContentType(contentType)) {
TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType);
fDocument.addPosition(fPositionCategory, p);
}
token= fScanner.nextToken();
}
} catch (BadLocationException x) {
// cannot happen as offsets come from scanner
} catch (BadPositionCategoryException x) {
// cannot happen if document has been connected before
}
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public void disconnect() {
Assert.isTrue(fDocument.containsPositionCategory(fPositionCategory));
try {
fDocument.removePositionCategory(fPositionCategory);
} catch (BadPositionCategoryException x) {
// can not happen because of Assert
}
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public void documentAboutToBeChanged(DocumentEvent e) {
if (fIsInitialized) {
Assert.isTrue(e.getDocument() == fDocument);
fPreviousDocumentLength= e.getDocument().getLength();
fStartOffset= -1;
fEndOffset= -1;
fDeleteOffset= -1;
}
}
@Override
public final boolean documentChanged(DocumentEvent e) {
if (fIsInitialized) {
IRegion region= documentChanged2(e);
return (region != null);
}
return false;
}
/**
* Helper method for tracking the minimal region containing all partition changes.
* If <code>offset</code> is smaller than the remembered offset, <code>offset</code>
* will from now on be remembered. If <code>offset + length</code> is greater than
* the remembered end offset, it will be remembered from now on.
*
* @param offset the offset
* @param length the length
*/
private void rememberRegion(int offset, int length) {
// remember start offset
if (fStartOffset == -1)
fStartOffset= offset;
else if (offset < fStartOffset)
fStartOffset= offset;
// remember end offset
int endOffset= offset + length;
if (fEndOffset == -1)
fEndOffset= endOffset;
else if (endOffset > fEndOffset)
fEndOffset= endOffset;
}
/**
* Remembers the given offset as the deletion offset.
*
* @param offset the offset
*/
private void rememberDeletedOffset(int offset) {
fDeleteOffset= offset;
}
/**
* Creates the minimal region containing all partition changes using the
* remembered offset, end offset, and deletion offset.
*
* @return the minimal region containing all the partition changes
*/
private IRegion createRegion() {
if (fDeleteOffset == -1) {
if (fStartOffset == -1 || fEndOffset == -1)
return null;
return new Region(fStartOffset, fEndOffset - fStartOffset);
} else if (fStartOffset == -1 || fEndOffset == -1) {
return new Region(fDeleteOffset, 0);
} else {
int offset= Math.min(fDeleteOffset, fStartOffset);
int endOffset= Math.max(fDeleteOffset, fEndOffset);
return new Region(offset, endOffset - offset);
}
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public IRegion documentChanged2(DocumentEvent e) {
if (!fIsInitialized)
return null;
try {
Assert.isTrue(e.getDocument() == fDocument);
Position[] category= getPositions();
IRegion line= fDocument.getLineInformationOfOffset(e.getOffset());
int reparseStart= line.getOffset();
int partitionStart= -1;
String contentType= null;
int newLength= e.getText() == null ? 0 : e.getText().length();
int first= fDocument.computeIndexInCategory(fPositionCategory, reparseStart);
if (first > 0) {
TypedPosition partition= (TypedPosition) category[first - 1];
if (partition.includes(reparseStart)) {
partitionStart= partition.getOffset();
contentType= partition.getType();
reparseStart= partitionStart;
-- first;
} else if (reparseStart == e.getOffset() && reparseStart == partition.getOffset() + partition.getLength()) {
partitionStart= partition.getOffset();
contentType= partition.getType();
reparseStart= partitionStart;
-- first;
} else {
partitionStart= partition.getOffset() + partition.getLength();
contentType= IDocument.DEFAULT_CONTENT_TYPE;
}
} else {
partitionStart= 0;
reparseStart= 0;
}
fPositionUpdater.update(e);
for (int i= first; i < category.length; i++) {
Position p= category[i];
if (p.isDeleted) {
rememberDeletedOffset(e.getOffset());
break;
}
}
clearPositionCache();
category= getPositions();
fScanner.setPartialRange(fDocument, reparseStart, fDocument.getLength() - reparseStart, contentType, partitionStart);
int behindLastScannedPosition= reparseStart;
IToken token= fScanner.nextToken();
while (!token.isEOF()) {
contentType= getTokenContentType(token);
if (!isSupportedContentType(contentType)) {
token= fScanner.nextToken();
continue;
}
int start= fScanner.getTokenOffset();
int length= fScanner.getTokenLength();
behindLastScannedPosition= start + length;
int lastScannedPosition= behindLastScannedPosition - 1;
// remove all affected positions
while (first < category.length) {
TypedPosition p= (TypedPosition) category[first];
if (lastScannedPosition >= p.offset + p.length ||
(p.overlapsWith(start, length) &&
(!fDocument.containsPosition(fPositionCategory, start, length) ||
!contentType.equals(p.getType())))) {
rememberRegion(p.offset, p.length);
fDocument.removePosition(fPositionCategory, p);
++ first;
} else
break;
}
// if position already exists and we have scanned at least the
// area covered by the event, we are done
if (fDocument.containsPosition(fPositionCategory, start, length)) {
if (lastScannedPosition >= e.getOffset() + newLength)
return createRegion();
++ first;
} else {
// insert the new type position
try {
fDocument.addPosition(fPositionCategory, new TypedPosition(start, length, contentType));
rememberRegion(start, length);
} catch (BadPositionCategoryException x) {
} catch (BadLocationException x) {
}
}
token= fScanner.nextToken();
}
first= fDocument.computeIndexInCategory(fPositionCategory, behindLastScannedPosition);
clearPositionCache();
category= getPositions();
TypedPosition p;
while (first < category.length) {
p= (TypedPosition) category[first++];
fDocument.removePosition(fPositionCategory, p);
rememberRegion(p.offset, p.length);
}
} catch (BadPositionCategoryException x) {
// should never happen on connected documents
} catch (BadLocationException x) {
} finally {
clearPositionCache();
}
return createRegion();
}
/**
* Returns the position in the partitoner's position category which is
* close to the given offset. This is, the position has either an offset which
* is the same as the given offset or an offset which is smaller than the given
* offset. This method profits from the knowledge that a partitioning is
* a ordered set of disjoint position.
* <p>
* May be extended or replaced by subclasses.
* </p>
* @param offset the offset for which to search the closest position
* @return the closest position in the partitioner's category
*/
protected TypedPosition findClosestPosition(int offset) {
try {
int index= fDocument.computeIndexInCategory(fPositionCategory, offset);
Position[] category= getPositions();
if (category.length == 0)
return null;
if (index < category.length) {
if (offset == category[index].offset)
return (TypedPosition) category[index];
}
if (index > 0)
index--;
return (TypedPosition) category[index];
} catch (BadPositionCategoryException x) {
} catch (BadLocationException x) {
}
return null;
}
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public String getContentType(int offset) {
checkInitialization();
TypedPosition p= findClosestPosition(offset);
if (p != null && p.includes(offset))
return p.getType();
return IDocument.DEFAULT_CONTENT_TYPE;
}
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public ITypedRegion getPartition(int offset) {
checkInitialization();
try {
Position[] category = getPositions();
if (category == null || category.length == 0)
return new TypedRegion(0, fDocument.getLength(), IDocument.DEFAULT_CONTENT_TYPE);
int index= fDocument.computeIndexInCategory(fPositionCategory, offset);
if (index < category.length) {
TypedPosition next= (TypedPosition) category[index];
if (offset == next.offset)
return new TypedRegion(next.getOffset(), next.getLength(), next.getType());
if (index == 0)
return new TypedRegion(0, next.offset, IDocument.DEFAULT_CONTENT_TYPE);
TypedPosition previous= (TypedPosition) category[index - 1];
if (previous.includes(offset))
return new TypedRegion(previous.getOffset(), previous.getLength(), previous.getType());
int endOffset= previous.getOffset() + previous.getLength();
return new TypedRegion(endOffset, next.getOffset() - endOffset, IDocument.DEFAULT_CONTENT_TYPE);
}
TypedPosition previous= (TypedPosition) category[category.length - 1];
if (previous.includes(offset))
return new TypedRegion(previous.getOffset(), previous.getLength(), previous.getType());
int endOffset= previous.getOffset() + previous.getLength();
return new TypedRegion(endOffset, fDocument.getLength() - endOffset, IDocument.DEFAULT_CONTENT_TYPE);
} catch (BadPositionCategoryException x) {
} catch (BadLocationException x) {
}
return new TypedRegion(0, fDocument.getLength(), IDocument.DEFAULT_CONTENT_TYPE);
}
@Override
public final ITypedRegion[] computePartitioning(int offset, int length) {
return computePartitioning(offset, length, false);
}
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public String[] getLegalContentTypes() {
return TextUtilities.copy(fLegalContentTypes);
}
/**
* Returns whether the given type is one of the legal content types.
* <p>
* May be extended by subclasses.
* </p>
*
* @param contentType the content type to check
* @return <code>true</code> if the content type is a legal content type
*/
protected boolean isSupportedContentType(String contentType) {
if (contentType != null) {
for (String fLegalContentType : fLegalContentTypes) {
if (fLegalContentType.equals(contentType))
return true;
}
}
return false;
}
/**
* Returns a content type encoded in the given token. If the token's
* data is not <code>null</code> and a string it is assumed that
* it is the encoded content type.
* <p>
* May be replaced or extended by subclasses.
* </p>
*
* @param token the token whose content type is to be determined
* @return the token's content type
*/
protected String getTokenContentType(IToken token) {
Object data= token.getData();
if (data instanceof String)
return (String) data;
return null;
}
/* zero-length partition support */
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public String getContentType(int offset, boolean preferOpenPartitions) {
return getPartition(offset, preferOpenPartitions).getType();
}
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public ITypedRegion getPartition(int offset, boolean preferOpenPartitions) {
ITypedRegion region= getPartition(offset);
if (preferOpenPartitions) {
if (region.getOffset() == offset && !region.getType().equals(IDocument.DEFAULT_CONTENT_TYPE)) {
if (offset > 0) {
region= getPartition(offset - 1);
if (region.getType().equals(IDocument.DEFAULT_CONTENT_TYPE))
return region;
}
return new TypedRegion(offset, 0, IDocument.DEFAULT_CONTENT_TYPE);
}
}
return region;
}
/**
* {@inheritDoc}
* <p>
* May be replaced or extended by subclasses.
* </p>
*/
@Override
public ITypedRegion[] computePartitioning(int offset, int length, boolean includeZeroLengthPartitions) {
checkInitialization();
List<TypedRegion> list= new ArrayList<>();
try {
int endOffset= offset + length;
Position[] category= getPositions();
TypedPosition previous= null, current= null;
int start, end, gapOffset;
Position gap= new Position(0);
int startIndex= getFirstIndexEndingAfterOffset(category, offset);
int endIndex= getFirstIndexStartingAfterOffset(category, endOffset);
for (int i= startIndex; i < endIndex; i++) {
current= (TypedPosition) category[i];
gapOffset= (previous != null) ? previous.getOffset() + previous.getLength() : 0;
gap.setOffset(gapOffset);
gap.setLength(current.getOffset() - gapOffset);
if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
(gap.getLength() > 0 && gap.overlapsWith(offset, length))) {
start= Math.max(offset, gapOffset);
end= Math.min(endOffset, gap.getOffset() + gap.getLength());
list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
}
if (current.overlapsWith(offset, length)) {
start= Math.max(offset, current.getOffset());
end= Math.min(endOffset, current.getOffset() + current.getLength());
list.add(new TypedRegion(start, end - start, current.getType()));
}
previous= current;
}
if (previous != null) {
gapOffset= previous.getOffset() + previous.getLength();
gap.setOffset(gapOffset);
gap.setLength(fDocument.getLength() - gapOffset);
if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
(gap.getLength() > 0 && gap.overlapsWith(offset, length))) {
start= Math.max(offset, gapOffset);
end= Math.min(endOffset, fDocument.getLength());
list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
}
}
if (list.isEmpty())
list.add(new TypedRegion(offset, length, IDocument.DEFAULT_CONTENT_TYPE));
} catch (BadPositionCategoryException ex) {
// Make sure we clear the cache
clearPositionCache();
} catch (RuntimeException ex) {
// Make sure we clear the cache
clearPositionCache();
throw ex;
}
TypedRegion[] result= new TypedRegion[list.size()];
list.toArray(result);
return result;
}
/**
* Returns <code>true</code> if the given ranges overlap with or touch each other.
*
* @param gap the first range
* @param offset the offset of the second range
* @param length the length of the second range
* @return <code>true</code> if the given ranges overlap with or touch each other
*/
private boolean overlapsOrTouches(Position gap, int offset, int length) {
return gap.getOffset() <= offset + length && offset <= gap.getOffset() + gap.getLength();
}
/**
* Returns the index of the first position which ends after the given offset.
*
* @param positions the positions in linear order
* @param offset the offset
* @return the index of the first position which ends after the offset
*/
private int getFirstIndexEndingAfterOffset(Position[] positions, int offset) {
int i= -1, j= positions.length;
while (j - i > 1) {
int k= (i + j) >> 1;
Position p= positions[k];
if (p.getOffset() + p.getLength() > offset)
j= k;
else
i= k;
}
return j;
}
/**
* Returns the index of the first position which starts at or after the given offset.
*
* @param positions the positions in linear order
* @param offset the offset
* @return the index of the first position which starts after the offset
*/
private int getFirstIndexStartingAfterOffset(Position[] positions, int offset) {
int i= -1, j= positions.length;
while (j - i > 1) {
int k= (i + j) >> 1;
Position p= positions[k];
if (p.getOffset() >= offset)
j= k;
else
i= k;
}
return j;
}
@Override
public void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException {
if (fActiveRewriteSession != null)
throw new IllegalStateException();
fActiveRewriteSession= session;
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public void stopRewriteSession(DocumentRewriteSession session) {
if (fActiveRewriteSession == session)
flushRewriteSession();
}
/**
* {@inheritDoc}
* <p>
* May be extended by subclasses.
* </p>
*/
@Override
public DocumentRewriteSession getActiveRewriteSession() {
return fActiveRewriteSession;
}
/**
* Flushes the active rewrite session.
*/
protected final void flushRewriteSession() {
fActiveRewriteSession= null;
// remove all position belonging to the partitioner position category
try {
fDocument.removePositionCategory(fPositionCategory);
} catch (BadPositionCategoryException x) {
}
fDocument.addPositionCategory(fPositionCategory);
fIsInitialized= false;
}
/**
* Clears the position cache. Needs to be called whenever the positions have
* been updated.
*/
protected final void clearPositionCache() {
if (fCachedPositions != null) {
fCachedPositions= null;
}
}
/**
* Returns the partitioners positions.
*
* @return the partitioners positions
* @throws BadPositionCategoryException if getting the positions from the
* document fails
*/
protected final Position[] getPositions() throws BadPositionCategoryException {
if (fCachedPositions == null) {
fCachedPositions= fDocument.getPositions(fPositionCategory);
} else if (CHECK_CACHE_CONSISTENCY) {
Position[] positions= fDocument.getPositions(fPositionCategory);
int len= Math.min(positions.length, fCachedPositions.length);
for (int i= 0; i < len; i++) {
if (!positions[i].equals(fCachedPositions[i]))
System.err.println("FastPartitioner.getPositions(): cached position is not up to date: from document: " + toString(positions[i]) + " in cache: " + toString(fCachedPositions[i])); //$NON-NLS-1$ //$NON-NLS-2$
}
for (int i= len; i < positions.length; i++)
System.err.println("FastPartitioner.getPositions(): new position in document: " + toString(positions[i])); //$NON-NLS-1$
for (int i= len; i < fCachedPositions.length; i++)
System.err.println("FastPartitioner.getPositions(): stale position in cache: " + toString(fCachedPositions[i])); //$NON-NLS-1$
}
return fCachedPositions;
}
/**
* Pretty print a <code>Position</code>.
*
* @param position the position to format
* @return a formatted string
*/
private String toString(Position position) {
return "P[" + position.getOffset() + "+" + position.getLength() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
| elucash/eclipse-oxygen | org.eclipse.jface.text/src/org/eclipse/jface/text/rules/FastPartitioner.java | Java | epl-1.0 | 24,915 | 29.163438 | 211 | 0.701224 | false |
package mesfavoris.bookmarktype;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.Optional;
import mesfavoris.model.Bookmark;
public abstract class AbstractBookmarkMarkerPropertiesProvider implements IBookmarkMarkerAttributesProvider {
protected Optional<String> getMessage(Bookmark bookmark) {
String comment = bookmark.getPropertyValue(Bookmark.PROPERTY_COMMENT);
if (comment == null) {
return Optional.empty();
}
try (BufferedReader br = new BufferedReader(new StringReader(comment))) {
return Optional.ofNullable(br.readLine());
} catch (IOException e) {
return Optional.empty();
}
}
}
| cchabanois/mesfavoris | bundles/mesfavoris/src/mesfavoris/bookmarktype/AbstractBookmarkMarkerPropertiesProvider.java | Java | epl-1.0 | 675 | 27.125 | 109 | 0.776296 | false |
/*******************************************************************************
* Copyright (c) 2000, 2008 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.jface.text.source;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.JFaceTextUtil;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.projection.AnnotationBag;
/**
* Ruler presented next to a source viewer showing all annotations of the
* viewer's annotation model in a compact format. The ruler has the same height
* as the source viewer.
* <p>
* Clients usually instantiate and configure objects of this class.</p>
*
* @since 2.1
*/
public class OverviewRuler implements IOverviewRuler {
/**
* Internal listener class.
*/
class InternalListener implements ITextListener, IAnnotationModelListener, IAnnotationModelListenerExtension {
/*
* @see ITextListener#textChanged
*/
public void textChanged(TextEvent e) {
if (fTextViewer != null && e.getDocumentEvent() == null && e.getViewerRedrawState()) {
// handle only changes of visible document
redraw();
}
}
/*
* @see IAnnotationModelListener#modelChanged(IAnnotationModel)
*/
public void modelChanged(IAnnotationModel model) {
update();
}
/*
* @see org.eclipse.jface.text.source.IAnnotationModelListenerExtension#modelChanged(org.eclipse.jface.text.source.AnnotationModelEvent)
* @since 3.3
*/
public void modelChanged(AnnotationModelEvent event) {
if (!event.isValid())
return;
if (event.isWorldChange()) {
update();
return;
}
Annotation[] annotations= event.getAddedAnnotations();
int length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
annotations= event.getRemovedAnnotations();
length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
annotations= event.getChangedAnnotations();
length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
}
}
/**
* Enumerates the annotations of a specified type and characteristics
* of the associated annotation model.
*/
class FilterIterator implements Iterator {
final static int TEMPORARY= 1 << 1;
final static int PERSISTENT= 1 << 2;
final static int IGNORE_BAGS= 1 << 3;
private Iterator fIterator;
private Object fType;
private Annotation fNext;
private int fStyle;
/**
* Creates a new filter iterator with the given specification.
*
* @param annotationType the annotation type
* @param style the style
*/
public FilterIterator(Object annotationType, int style) {
fType= annotationType;
fStyle= style;
if (fModel != null) {
fIterator= fModel.getAnnotationIterator();
skip();
}
}
/**
* Creates a new filter iterator with the given specification.
*
* @param annotationType the annotation type
* @param style the style
* @param iterator the iterator
*/
public FilterIterator(Object annotationType, int style, Iterator iterator) {
fType= annotationType;
fStyle= style;
fIterator= iterator;
skip();
}
private void skip() {
boolean temp= (fStyle & TEMPORARY) != 0;
boolean pers= (fStyle & PERSISTENT) != 0;
boolean ignr= (fStyle & IGNORE_BAGS) != 0;
while (fIterator.hasNext()) {
Annotation next= (Annotation) fIterator.next();
if (next.isMarkedDeleted())
continue;
if (ignr && (next instanceof AnnotationBag))
continue;
fNext= next;
Object annotationType= next.getType();
if (fType == null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) {
if (temp && pers) return;
if (pers && next.isPersistent()) return;
if (temp && !next.isPersistent()) return;
}
}
fNext= null;
}
private boolean isSubtype(Object annotationType) {
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
return extension.isSubtype(annotationType, fType);
}
return fType.equals(annotationType);
}
/*
* @see Iterator#hasNext()
*/
public boolean hasNext() {
return fNext != null;
}
/*
* @see Iterator#next()
*/
public Object next() {
try {
return fNext;
} finally {
if (fIterator != null)
skip();
}
}
/*
* @see Iterator#remove()
*/
public void remove() {
throw new UnsupportedOperationException();
}
}
/**
* The painter of the overview ruler's header.
*/
class HeaderPainter implements PaintListener {
private Color fIndicatorColor;
private Color fSeparatorColor;
/**
* Creates a new header painter.
*/
public HeaderPainter() {
fSeparatorColor= fHeader.getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
}
/**
* Sets the header color.
*
* @param color the header color
*/
public void setColor(Color color) {
fIndicatorColor= color;
}
private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topLeft, Color bottomRight) {
gc.setForeground(topLeft == null ? fSeparatorColor : topLeft);
gc.drawLine(x, y, x + w -1, y);
gc.drawLine(x, y, x, y + h -1);
gc.setForeground(bottomRight == null ? fSeparatorColor : bottomRight);
gc.drawLine(x + w, y, x + w, y + h);
gc.drawLine(x, y + h, x + w, y + h);
}
public void paintControl(PaintEvent e) {
if (fIndicatorColor == null)
return;
Point s= fHeader.getSize();
e.gc.setBackground(fIndicatorColor);
Rectangle r= new Rectangle(INSET, (s.y - (2*ANNOTATION_HEIGHT)) / 2, s.x - (2*INSET), 2*ANNOTATION_HEIGHT);
e.gc.fillRectangle(r);
Display d= fHeader.getDisplay();
if (d != null)
// drawBevelRect(e.gc, r.x, r.y, r.width -1, r.height -1, d.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW), d.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
drawBevelRect(e.gc, r.x, r.y, r.width -1, r.height -1, null, null);
e.gc.setForeground(fSeparatorColor);
e.gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
e.gc.drawLine(0, s.y -1, s.x -1, s.y -1);
}
}
private static final int INSET= 2;
private static final int ANNOTATION_HEIGHT= 4;
private static boolean ANNOTATION_HEIGHT_SCALABLE= true;
/** The model of the overview ruler */
private IAnnotationModel fModel;
/** The view to which this ruler is connected */
private ITextViewer fTextViewer;
/** The ruler's canvas */
private Canvas fCanvas;
/** The ruler's header */
private Canvas fHeader;
/** The buffer for double buffering */
private Image fBuffer;
/** The internal listener */
private InternalListener fInternalListener= new InternalListener();
/** The width of this vertical ruler */
private int fWidth;
/** The hit detection cursor. Do not dispose. */
private Cursor fHitDetectionCursor;
/** The last cursor. Do not dispose. */
private Cursor fLastCursor;
/** The line of the last mouse button activity */
private int fLastMouseButtonActivityLine= -1;
/** The actual annotation height */
private int fAnnotationHeight= -1;
/** The annotation access */
private IAnnotationAccess fAnnotationAccess;
/** The header painter */
private HeaderPainter fHeaderPainter;
/**
* The list of annotation types to be shown in this ruler.
* @since 3.0
*/
private Set fConfiguredAnnotationTypes= new HashSet();
/**
* The list of annotation types to be shown in the header of this ruler.
* @since 3.0
*/
private Set fConfiguredHeaderAnnotationTypes= new HashSet();
/** The mapping between annotation types and colors */
private Map fAnnotationTypes2Colors= new HashMap();
/** The color manager */
private ISharedTextColors fSharedTextColors;
/**
* All available annotation types sorted by layer.
*
* @since 3.0
*/
private List fAnnotationsSortedByLayer= new ArrayList();
/**
* All available layers sorted by layer.
* This list may contain duplicates.
* @since 3.0
*/
private List fLayersSortedByLayer= new ArrayList();
/**
* Map of allowed annotation types.
* An allowed annotation type maps to <code>true</code>, a disallowed
* to <code>false</code>.
* @since 3.0
*/
private Map fAllowedAnnotationTypes= new HashMap();
/**
* Map of allowed header annotation types.
* An allowed annotation type maps to <code>true</code>, a disallowed
* to <code>false</code>.
* @since 3.0
*/
private Map fAllowedHeaderAnnotationTypes= new HashMap();
/**
* The cached annotations.
* @since 3.0
*/
private List fCachedAnnotations= new ArrayList();
/**
* Redraw runnable lock
* @since 3.3
*/
private Object fRunnableLock= new Object();
/**
* Redraw runnable state
* @since 3.3
*/
private boolean fIsRunnablePosted= false;
/**
* Redraw runnable
* @since 3.3
*/
private Runnable fRunnable= new Runnable() {
public void run() {
synchronized (fRunnableLock) {
fIsRunnablePosted= false;
}
redraw();
updateHeader();
}
};
/**
* Tells whether temporary annotations are drawn with
* a separate color. This color will be computed by
* discoloring the original annotation color.
*
* @since 3.4
*/
private boolean fIsTemporaryAnnotationDiscolored;
/**
* Constructs a overview ruler of the given width using the given annotation access and the given
* color manager.
* <p><strong>Note:</strong> As of 3.4, temporary annotations are no longer discolored.
* Use {@link #OverviewRuler(IAnnotationAccess, int, ISharedTextColors, boolean)} if you
* want to keep the old behavior.</p>
*
* @param annotationAccess the annotation access
* @param width the width of the vertical ruler
* @param sharedColors the color manager
*/
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors) {
this(annotationAccess, width, sharedColors, false);
}
/**
* Constructs a overview ruler of the given width using the given annotation
* access and the given color manager.
*
* @param annotationAccess the annotation access
* @param width the width of the vertical ruler
* @param sharedColors the color manager
* @param discolorTemporaryAnnotation <code>true</code> if temporary annotations should be discolored
* @since 3.4
*/
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors, boolean discolorTemporaryAnnotation) {
fAnnotationAccess= annotationAccess;
fWidth= width;
fSharedTextColors= sharedColors;
fIsTemporaryAnnotationDiscolored= discolorTemporaryAnnotation;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRulerInfo#getControl()
*/
public Control getControl() {
return fCanvas;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRulerInfo#getWidth()
*/
public int getWidth() {
return fWidth;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#setModel(org.eclipse.jface.text.source.IAnnotationModel)
*/
public void setModel(IAnnotationModel model) {
if (model != fModel || model != null) {
if (fModel != null)
fModel.removeAnnotationModelListener(fInternalListener);
fModel= model;
if (fModel != null)
fModel.addAnnotationModelListener(fInternalListener);
update();
}
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#createControl(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.ITextViewer)
*/
public Control createControl(Composite parent, ITextViewer textViewer) {
fTextViewer= textViewer;
fHitDetectionCursor= parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND);
fHeader= new Canvas(parent, SWT.NONE);
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
fHeader.addMouseTrackListener(new MouseTrackAdapter() {
/*
* @see org.eclipse.swt.events.MouseTrackAdapter#mouseHover(org.eclipse.swt.events.MouseEvent)
* @since 3.3
*/
public void mouseEnter(MouseEvent e) {
updateHeaderToolTipText();
}
});
}
fCanvas= new Canvas(parent, SWT.NO_BACKGROUND);
fCanvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
if (fTextViewer != null)
doubleBufferPaint(event.gc);
}
});
fCanvas.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
handleDispose();
fTextViewer= null;
}
});
fCanvas.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent event) {
handleMouseDown(event);
}
});
fCanvas.addMouseMoveListener(new MouseMoveListener() {
public void mouseMove(MouseEvent event) {
handleMouseMove(event);
}
});
if (fTextViewer != null)
fTextViewer.addTextListener(fInternalListener);
return fCanvas;
}
/**
* Disposes the ruler's resources.
*/
private void handleDispose() {
if (fTextViewer != null) {
fTextViewer.removeTextListener(fInternalListener);
fTextViewer= null;
}
if (fModel != null)
fModel.removeAnnotationModelListener(fInternalListener);
if (fBuffer != null) {
fBuffer.dispose();
fBuffer= null;
}
fConfiguredAnnotationTypes.clear();
fAllowedAnnotationTypes.clear();
fConfiguredHeaderAnnotationTypes.clear();
fAllowedHeaderAnnotationTypes.clear();
fAnnotationTypes2Colors.clear();
fAnnotationsSortedByLayer.clear();
fLayersSortedByLayer.clear();
}
/**
* Double buffer drawing.
*
* @param dest the GC to draw into
*/
private void doubleBufferPaint(GC dest) {
Point size= fCanvas.getSize();
if (size.x <= 0 || size.y <= 0)
return;
if (fBuffer != null) {
Rectangle r= fBuffer.getBounds();
if (r.width != size.x || r.height != size.y) {
fBuffer.dispose();
fBuffer= null;
}
}
if (fBuffer == null)
fBuffer= new Image(fCanvas.getDisplay(), size.x, size.y);
GC gc= new GC(fBuffer);
try {
gc.setBackground(fCanvas.getBackground());
gc.fillRectangle(0, 0, size.x, size.y);
cacheAnnotations();
if (fTextViewer instanceof ITextViewerExtension5)
doPaint1(gc);
else
doPaint(gc);
} finally {
gc.dispose();
}
dest.drawImage(fBuffer, 0, 0);
}
/**
* Draws this overview ruler.
*
* @param gc the GC to draw into
*/
private void doPaint(GC gc) {
Rectangle r= new Rectangle(0, 0, 0, 0);
int yy, hh= ANNOTATION_HEIGHT;
IDocument document= fTextViewer.getDocument();
IRegion visible= fTextViewer.getVisibleRegion();
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getLineCount();
Point size= fCanvas.getSize();
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (size.y > writable)
size.y= Math.max(writable - fHeader.getSize().y, 0);
for (Iterator iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) {
Object annotationType= iterator.next();
if (skip(annotationType))
continue;
int[] style= new int[] { FilterIterator.PERSISTENT, FilterIterator.TEMPORARY };
for (int t=0; t < style.length; t++) {
Iterator e= new FilterIterator(annotationType, style[t], fCachedAnnotations.iterator());
boolean areColorsComputed= false;
Color fill= null;
Color stroke= null;
for (int i= 0; e.hasNext(); i++) {
Annotation a= (Annotation) e.next();
Position p= fModel.getPosition(a);
if (p == null || !p.overlapsWith(visible.getOffset(), visible.getLength()))
continue;
int annotationOffset= Math.max(p.getOffset(), visible.getOffset());
int annotationEnd= Math.min(p.getOffset() + p.getLength(), visible.getOffset() + visible.getLength());
int annotationLength= annotationEnd - annotationOffset;
try {
if (ANNOTATION_HEIGHT_SCALABLE) {
int numbersOfLines= document.getNumberOfLines(annotationOffset, annotationLength);
// don't count empty trailing lines
IRegion lastLine= document.getLineInformationOfOffset(annotationOffset + annotationLength);
if (lastLine.getOffset() == annotationOffset + annotationLength) {
numbersOfLines -= 2;
hh= (numbersOfLines * size.y) / maxLines + ANNOTATION_HEIGHT;
if (hh < ANNOTATION_HEIGHT)
hh= ANNOTATION_HEIGHT;
} else
hh= ANNOTATION_HEIGHT;
}
fAnnotationHeight= hh;
int startLine= textWidget.getLineAtOffset(annotationOffset - visible.getOffset());
yy= Math.min((startLine * size.y) / maxLines, size.y - hh);
if (!areColorsComputed) {
fill= getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY);
stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY);
areColorsComputed= true;
}
if (fill != null) {
gc.setBackground(fill);
gc.fillRectangle(INSET, yy, size.x-(2*INSET), hh);
}
if (stroke != null) {
gc.setForeground(stroke);
r.x= INSET;
r.y= yy;
r.width= size.x - (2 * INSET);
r.height= hh;
gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
gc.drawRectangle(r);
}
} catch (BadLocationException x) {
}
}
}
}
}
private void cacheAnnotations() {
fCachedAnnotations.clear();
if (fModel != null) {
Iterator iter= fModel.getAnnotationIterator();
while (iter.hasNext()) {
Annotation annotation= (Annotation) iter.next();
if (annotation.isMarkedDeleted())
continue;
if (skip(annotation.getType()))
continue;
fCachedAnnotations.add(annotation);
}
}
}
/**
* Draws this overview ruler. Uses <code>ITextViewerExtension5</code> for
* its implementation. Will replace <code>doPaint(GC)</code>.
*
* @param gc the GC to draw into
*/
private void doPaint1(GC gc) {
Rectangle r= new Rectangle(0, 0, 0, 0);
int yy, hh= ANNOTATION_HEIGHT;
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
IDocument document= fTextViewer.getDocument();
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getLineCount();
Point size= fCanvas.getSize();
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (size.y > writable)
size.y= Math.max(writable - fHeader.getSize().y, 0);
for (Iterator iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) {
Object annotationType= iterator.next();
if (skip(annotationType))
continue;
int[] style= new int[] { FilterIterator.PERSISTENT, FilterIterator.TEMPORARY };
for (int t=0; t < style.length; t++) {
Iterator e= new FilterIterator(annotationType, style[t], fCachedAnnotations.iterator());
boolean areColorsComputed= false;
Color fill= null;
Color stroke= null;
for (int i= 0; e.hasNext(); i++) {
Annotation a= (Annotation) e.next();
Position p= fModel.getPosition(a);
if (p == null)
continue;
IRegion widgetRegion= extension.modelRange2WidgetRange(new Region(p.getOffset(), p.getLength()));
if (widgetRegion == null)
continue;
try {
if (ANNOTATION_HEIGHT_SCALABLE) {
int numbersOfLines= document.getNumberOfLines(p.getOffset(), p.getLength());
// don't count empty trailing lines
IRegion lastLine= document.getLineInformationOfOffset(p.getOffset() + p.getLength());
if (lastLine.getOffset() == p.getOffset() + p.getLength()) {
numbersOfLines -= 2;
hh= (numbersOfLines * size.y) / maxLines + ANNOTATION_HEIGHT;
if (hh < ANNOTATION_HEIGHT)
hh= ANNOTATION_HEIGHT;
} else
hh= ANNOTATION_HEIGHT;
}
fAnnotationHeight= hh;
int startLine= textWidget.getLineAtOffset(widgetRegion.getOffset());
yy= Math.min((startLine * size.y) / maxLines, size.y - hh);
if (!areColorsComputed) {
fill= getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY);
stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY);
areColorsComputed= true;
}
if (fill != null) {
gc.setBackground(fill);
gc.fillRectangle(INSET, yy, size.x-(2*INSET), hh);
}
if (stroke != null) {
gc.setForeground(stroke);
r.x= INSET;
r.y= yy;
r.width= size.x - (2 * INSET);
r.height= hh;
gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
gc.drawRectangle(r);
}
} catch (BadLocationException x) {
}
}
}
}
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#update()
*/
public void update() {
if (fCanvas != null && !fCanvas.isDisposed()) {
Display d= fCanvas.getDisplay();
if (d != null) {
synchronized (fRunnableLock) {
if (fIsRunnablePosted)
return;
fIsRunnablePosted= true;
}
d.asyncExec(fRunnable);
}
}
}
/**
* Redraws the overview ruler.
*/
private void redraw() {
if (fTextViewer == null || fModel == null)
return;
if (fCanvas != null && !fCanvas.isDisposed()) {
GC gc= new GC(fCanvas);
doubleBufferPaint(gc);
gc.dispose();
}
}
/**
* Translates a given y-coordinate of this ruler into the corresponding
* document lines. The number of lines depends on the concrete scaling
* given as the ration between the height of this ruler and the length
* of the document.
*
* @param y_coordinate the y-coordinate
* @return the corresponding document lines
*/
private int[] toLineNumbers(int y_coordinate) {
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getContent().getLineCount();
int rulerLength= fCanvas.getSize().y;
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (rulerLength > writable)
rulerLength= Math.max(writable - fHeader.getSize().y, 0);
if (y_coordinate >= writable || y_coordinate >= rulerLength)
return new int[] {-1, -1};
int[] lines= new int[2];
int pixel0= Math.max(y_coordinate - 1, 0);
int pixel1= Math.min(rulerLength, y_coordinate + 1);
rulerLength= Math.max(rulerLength, 1);
lines[0]= (pixel0 * maxLines) / rulerLength;
lines[1]= (pixel1 * maxLines) / rulerLength;
if (fTextViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
lines[0]= extension.widgetLine2ModelLine(lines[0]);
lines[1]= extension.widgetLine2ModelLine(lines[1]);
} else {
try {
IRegion visible= fTextViewer.getVisibleRegion();
int lineNumber= fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
lines[0] += lineNumber;
lines[1] += lineNumber;
} catch (BadLocationException x) {
}
}
return lines;
}
/**
* Returns the position of the first annotation found in the given line range.
*
* @param lineNumbers the line range
* @return the position of the first found annotation
*/
private Position getAnnotationPosition(int[] lineNumbers) {
if (lineNumbers[0] == -1)
return null;
Position found= null;
try {
IDocument d= fTextViewer.getDocument();
IRegion line= d.getLineInformation(lineNumbers[0]);
int start= line.getOffset();
line= d.getLineInformation(lineNumbers[lineNumbers.length - 1]);
int end= line.getOffset() + line.getLength();
for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY);
while (e.hasNext() && found == null) {
Annotation a= (Annotation) e.next();
if (a.isMarkedDeleted())
continue;
if (skip(a.getType()))
continue;
Position p= fModel.getPosition(a);
if (p == null)
continue;
int posOffset= p.getOffset();
int posEnd= posOffset + p.getLength();
IRegion region= d.getLineInformationOfOffset(posEnd);
// trailing empty lines don't count
if (posEnd > posOffset && region.getOffset() == posEnd) {
posEnd--;
region= d.getLineInformationOfOffset(posEnd);
}
if (posOffset <= end && posEnd >= start)
found= p;
}
}
} catch (BadLocationException x) {
}
return found;
}
/**
* Returns the line which corresponds best to one of
* the underlying annotations at the given y-coordinate.
*
* @param lineNumbers the line numbers
* @return the best matching line or <code>-1</code> if no such line can be found
*/
private int findBestMatchingLineNumber(int[] lineNumbers) {
if (lineNumbers == null || lineNumbers.length < 1)
return -1;
try {
Position pos= getAnnotationPosition(lineNumbers);
if (pos == null)
return -1;
return fTextViewer.getDocument().getLineOfOffset(pos.getOffset());
} catch (BadLocationException ex) {
return -1;
}
}
/**
* Handles mouse clicks.
*
* @param event the mouse button down event
*/
private void handleMouseDown(MouseEvent event) {
if (fTextViewer != null) {
int[] lines= toLineNumbers(event.y);
Position p= getAnnotationPosition(lines);
if (p == null && event.button == 1) {
try {
p= new Position(fTextViewer.getDocument().getLineInformation(lines[0]).getOffset(), 0);
} catch (BadLocationException e) {
// do nothing
}
}
if (p != null) {
fTextViewer.revealRange(p.getOffset(), p.getLength());
fTextViewer.setSelectedRange(p.getOffset(), p.getLength());
}
fTextViewer.getTextWidget().setFocus();
}
fLastMouseButtonActivityLine= toDocumentLineNumber(event.y);
}
/**
* Handles mouse moves.
*
* @param event the mouse move event
*/
private void handleMouseMove(MouseEvent event) {
if (fTextViewer != null) {
int[] lines= toLineNumbers(event.y);
Position p= getAnnotationPosition(lines);
Cursor cursor= (p != null ? fHitDetectionCursor : null);
if (cursor != fLastCursor) {
fCanvas.setCursor(cursor);
fLastCursor= cursor;
}
}
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#addAnnotationType(java.lang.Object)
*/
public void addAnnotationType(Object annotationType) {
fConfiguredAnnotationTypes.add(annotationType);
fAllowedAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#removeAnnotationType(java.lang.Object)
*/
public void removeAnnotationType(Object annotationType) {
fConfiguredAnnotationTypes.remove(annotationType);
fAllowedAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#setAnnotationTypeLayer(java.lang.Object, int)
*/
public void setAnnotationTypeLayer(Object annotationType, int layer) {
int j= fAnnotationsSortedByLayer.indexOf(annotationType);
if (j != -1) {
fAnnotationsSortedByLayer.remove(j);
fLayersSortedByLayer.remove(j);
}
if (layer >= 0) {
int i= 0;
int size= fLayersSortedByLayer.size();
while (i < size && layer >= ((Integer)fLayersSortedByLayer.get(i)).intValue())
i++;
Integer layerObj= new Integer(layer);
fLayersSortedByLayer.add(i, layerObj);
fAnnotationsSortedByLayer.add(i, annotationType);
}
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#setAnnotationTypeColor(java.lang.Object, org.eclipse.swt.graphics.Color)
*/
public void setAnnotationTypeColor(Object annotationType, Color color) {
if (color != null)
fAnnotationTypes2Colors.put(annotationType, color);
else
fAnnotationTypes2Colors.remove(annotationType);
}
/**
* Returns whether the given annotation type should be skipped by the drawing routine.
*
* @param annotationType the annotation type
* @return <code>true</code> if annotation of the given type should be skipped
*/
private boolean skip(Object annotationType) {
return !contains(annotationType, fAllowedAnnotationTypes, fConfiguredAnnotationTypes);
}
/**
* Returns whether the given annotation type should be skipped by the drawing routine of the header.
*
* @param annotationType the annotation type
* @return <code>true</code> if annotation of the given type should be skipped
* @since 3.0
*/
private boolean skipInHeader(Object annotationType) {
return !contains(annotationType, fAllowedHeaderAnnotationTypes, fConfiguredHeaderAnnotationTypes);
}
/**
* Returns whether the given annotation type is mapped to <code>true</code>
* in the given <code>allowed</code> map or covered by the <code>configured</code>
* set.
*
* @param annotationType the annotation type
* @param allowed the map with allowed annotation types mapped to booleans
* @param configured the set with configured annotation types
* @return <code>true</code> if annotation is contained, <code>false</code>
* otherwise
* @since 3.0
*/
private boolean contains(Object annotationType, Map allowed, Set configured) {
Boolean cached= (Boolean) allowed.get(annotationType);
if (cached != null)
return cached.booleanValue();
boolean covered= isCovered(annotationType, configured);
allowed.put(annotationType, covered ? Boolean.TRUE : Boolean.FALSE);
return covered;
}
/**
* Computes whether the annotations of the given type are covered by the given <code>configured</code>
* set. This is the case if either the type of the annotation or any of its
* super types is contained in the <code>configured</code> set.
*
* @param annotationType the annotation type
* @param configured the set with configured annotation types
* @return <code>true</code> if annotation is covered, <code>false</code>
* otherwise
* @since 3.0
*/
private boolean isCovered(Object annotationType, Set configured) {
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
Iterator e= configured.iterator();
while (e.hasNext()) {
if (extension.isSubtype(annotationType,e.next()))
return true;
}
return false;
}
return configured.contains(annotationType);
}
/**
* Returns a specification of a color that lies between the given
* foreground and background color using the given scale factor.
*
* @param fg the foreground color
* @param bg the background color
* @param scale the scale factor
* @return the interpolated color
*/
private static RGB interpolate(RGB fg, RGB bg, double scale) {
return new RGB(
(int) ((1.0-scale) * fg.red + scale * bg.red),
(int) ((1.0-scale) * fg.green + scale * bg.green),
(int) ((1.0-scale) * fg.blue + scale * bg.blue)
);
}
/**
* Returns the grey value in which the given color would be drawn in grey-scale.
*
* @param rgb the color
* @return the grey-scale value
*/
private static double greyLevel(RGB rgb) {
if (rgb.red == rgb.green && rgb.green == rgb.blue)
return rgb.red;
return (0.299 * rgb.red + 0.587 * rgb.green + 0.114 * rgb.blue + 0.5);
}
/**
* Returns whether the given color is dark or light depending on the colors grey-scale level.
*
* @param rgb the color
* @return <code>true</code> if the color is dark, <code>false</code> if it is light
*/
private static boolean isDark(RGB rgb) {
return greyLevel(rgb) > 128;
}
/**
* Returns a color based on the color configured for the given annotation type and the given scale factor.
*
* @param annotationType the annotation type
* @param scale the scale factor
* @return the computed color
*/
private Color getColor(Object annotationType, double scale) {
Color base= findColor(annotationType);
if (base == null)
return null;
RGB baseRGB= base.getRGB();
RGB background= fCanvas.getBackground().getRGB();
boolean darkBase= isDark(baseRGB);
boolean darkBackground= isDark(background);
if (darkBase && darkBackground)
background= new RGB(255, 255, 255);
else if (!darkBase && !darkBackground)
background= new RGB(0, 0, 0);
return fSharedTextColors.getColor(interpolate(baseRGB, background, scale));
}
/**
* Returns the color for the given annotation type
*
* @param annotationType the annotation type
* @return the color
* @since 3.0
*/
private Color findColor(Object annotationType) {
Color color= (Color) fAnnotationTypes2Colors.get(annotationType);
if (color != null)
return color;
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
Object[] superTypes= extension.getSupertypes(annotationType);
if (superTypes != null) {
for (int i= 0; i < superTypes.length; i++) {
color= (Color) fAnnotationTypes2Colors.get(superTypes[i]);
if (color != null)
return color;
}
}
}
return null;
}
/**
* Returns the stroke color for the given annotation type and characteristics.
*
* @param annotationType the annotation type
* @param temporary <code>true</code> if for temporary annotations
* @return the stroke color
*/
private Color getStrokeColor(Object annotationType, boolean temporary) {
return getColor(annotationType, temporary && fIsTemporaryAnnotationDiscolored ? 0.5 : 0.2);
}
/**
* Returns the fill color for the given annotation type and characteristics.
*
* @param annotationType the annotation type
* @param temporary <code>true</code> if for temporary annotations
* @return the fill color
*/
private Color getFillColor(Object annotationType, boolean temporary) {
return getColor(annotationType, temporary && fIsTemporaryAnnotationDiscolored ? 0.9 : 0.75);
}
/*
* @see IVerticalRulerInfo#getLineOfLastMouseButtonActivity()
*/
public int getLineOfLastMouseButtonActivity() {
if (fLastMouseButtonActivityLine >= fTextViewer.getDocument().getNumberOfLines())
fLastMouseButtonActivityLine= -1;
return fLastMouseButtonActivityLine;
}
/*
* @see IVerticalRulerInfo#toDocumentLineNumber(int)
*/
public int toDocumentLineNumber(int y_coordinate) {
if (fTextViewer == null || y_coordinate == -1)
return -1;
int[] lineNumbers= toLineNumbers(y_coordinate);
int bestLine= findBestMatchingLineNumber(lineNumbers);
if (bestLine == -1 && lineNumbers.length > 0)
return lineNumbers[0];
return bestLine;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#getModel()
*/
public IAnnotationModel getModel() {
return fModel;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#getAnnotationHeight()
*/
public int getAnnotationHeight() {
return fAnnotationHeight;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#hasAnnotation(int)
*/
public boolean hasAnnotation(int y) {
return findBestMatchingLineNumber(toLineNumbers(y)) != -1;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#getHeaderControl()
*/
public Control getHeaderControl() {
return fHeader;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#addHeaderAnnotationType(java.lang.Object)
*/
public void addHeaderAnnotationType(Object annotationType) {
fConfiguredHeaderAnnotationTypes.add(annotationType);
fAllowedHeaderAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#removeHeaderAnnotationType(java.lang.Object)
*/
public void removeHeaderAnnotationType(Object annotationType) {
fConfiguredHeaderAnnotationTypes.remove(annotationType);
fAllowedHeaderAnnotationTypes.clear();
}
/**
* Updates the header of this ruler.
*/
private void updateHeader() {
if (fHeader == null || fHeader.isDisposed())
return;
fHeader.setToolTipText(null);
Object colorType= null;
outer: for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
if (skipInHeader(annotationType) || skip(annotationType))
continue;
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS, fCachedAnnotations.iterator());
while (e.hasNext()) {
if (e.next() != null) {
colorType= annotationType;
break outer;
}
}
}
Color color= null;
if (colorType != null)
color= findColor(colorType);
if (color == null) {
if (fHeaderPainter != null)
fHeaderPainter.setColor(null);
} else {
if (fHeaderPainter == null) {
fHeaderPainter= new HeaderPainter();
fHeader.addPaintListener(fHeaderPainter);
}
fHeaderPainter.setColor(color);
}
fHeader.redraw();
}
/**
* Updates the header tool tip text of this ruler.
*/
private void updateHeaderToolTipText() {
if (fHeader == null || fHeader.isDisposed())
return;
if (fHeader.getToolTipText() != null)
return;
String overview= ""; //$NON-NLS-1$
for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
if (skipInHeader(annotationType) || skip(annotationType))
continue;
int count= 0;
String annotationTypeLabel= null;
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS, fCachedAnnotations.iterator());
while (e.hasNext()) {
Annotation annotation= (Annotation)e.next();
if (annotation != null) {
if (annotationTypeLabel == null)
annotationTypeLabel= ((IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation);
count++;
}
}
if (annotationTypeLabel != null) {
if (overview.length() > 0)
overview += "\n"; //$NON-NLS-1$
overview += JFaceTextMessages.getFormattedString("OverviewRulerHeader.toolTipTextEntry", new Object[] {annotationTypeLabel, new Integer(count)}); //$NON-NLS-1$
}
}
if (overview.length() > 0)
fHeader.setToolTipText(overview);
}
}
| neelance/jface4ruby | jface4ruby/src/org/eclipse/jface/text/source/OverviewRuler.java | Java | epl-1.0 | 39,538 | 27.796795 | 164 | 0.691891 | false |
package org.cohorte.studio.eclipse.ui.node.project;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.json.JsonBuilderFactory;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.json.JsonWriter;
import javax.json.stream.JsonGenerator;
import org.cohorte.studio.eclipse.api.annotations.NonNull;
import org.cohorte.studio.eclipse.api.objects.IHttpTransport;
import org.cohorte.studio.eclipse.api.objects.INode;
import org.cohorte.studio.eclipse.api.objects.IRuntime;
import org.cohorte.studio.eclipse.api.objects.ITransport;
import org.cohorte.studio.eclipse.api.objects.IXmppTransport;
import org.cohorte.studio.eclipse.core.api.IProjectContentManager;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.e4.core.di.annotations.Creatable;
/**
* Node project content manager.
*
* @author Ahmad Shahwan
*
*/
@Creatable
public class CNodeContentManager implements IProjectContentManager<INode> {
private static final String CONF = "conf"; //$NON-NLS-1$
private static final String RUN_JS = new StringBuilder().append(CONF).append("/run.js").toString(); //$NON-NLS-1$
@SuppressWarnings("nls")
private interface IJsonKeys {
String NODE = "node";
String SHELL_PORT = "shell-port";
String HTTP_PORT = "http-port";
String NAME = "name";
String TOP_COMPOSER = "top-composer";
String CONSOLE = "console";
String COHORTE_VERSION = "cohorte-version";
String TRANSPORT = "transport";
String TRANSPORT_HTTP = "transport-http";
String HTTP_IPV = "http-ipv";
String TRANSPORT_XMPP = "transport-xmpp";
String XMPP_SERVER = "xmpp-server";
String XMPP_USER_ID = "xmpp-user-jid";
String XMPP_USER_PASSWORD = "xmpp-user-password";
String XMPP_PORT = "xmpp-port";
}
/**
* Constructor.
*/
@Inject
public CNodeContentManager() {
}
@Override
public void populate(@NonNull IProject aProject, INode aModel) throws CoreException {
if (!aProject.isOpen()) {
aProject.open(null);
}
aProject.getFolder(CONF).create(true, true, null);
IFile wRun = aProject.getFile(RUN_JS);
StringWriter wBuffer = new StringWriter();
Map<String, Object> wProperties = new HashMap<>(1);
wProperties.put(JsonGenerator.PRETTY_PRINTING, true);
JsonWriter wJWriter = Json.createWriterFactory(wProperties).createWriter(wBuffer);
JsonBuilderFactory wJ = Json.createBuilderFactory(null);
JsonObjectBuilder wJson = wJ.createObjectBuilder()
.add(IJsonKeys.NODE, wJ.createObjectBuilder()
.add(IJsonKeys.SHELL_PORT, 0)
.add(IJsonKeys.HTTP_PORT, 0)
.add(IJsonKeys.NAME, aModel.getName())
.add(IJsonKeys.TOP_COMPOSER, aModel.isComposer())
.add(IJsonKeys.CONSOLE, true));
JsonArrayBuilder wTransports = wJ.createArrayBuilder();
for (ITransport wTransport : aModel.getTransports()) {
wTransports.add(wTransport.getName());
if (wTransport instanceof IHttpTransport) {
IHttpTransport wHttp = (IHttpTransport) wTransport;
String wVer = wHttp.getVersion() == IHttpTransport.EVersion.IPV4 ? "4" : "6"; //$NON-NLS-1$//$NON-NLS-2$
wJson.add(IJsonKeys.TRANSPORT_HTTP, wJ.createObjectBuilder().add(IJsonKeys.HTTP_IPV, wVer));
}
if (wTransport instanceof IXmppTransport) {
IXmppTransport wXmpp = (IXmppTransport) wTransport;
JsonObjectBuilder wJsonXmpp = wJ.createObjectBuilder()
.add(IJsonKeys.XMPP_SERVER, wXmpp.getHostname())
.add(IJsonKeys.XMPP_PORT, wXmpp.getPort());
if (wXmpp.getUsername() != null) {
wJsonXmpp
.add(IJsonKeys.XMPP_USER_ID, wXmpp.getUsername())
.add(IJsonKeys.XMPP_USER_PASSWORD, wXmpp.getPassword());
}
wJson
.add(IJsonKeys.TRANSPORT_XMPP, wJsonXmpp);
}
}
wJson.add(IJsonKeys.TRANSPORT, wTransports);
IRuntime wRuntime = aModel.getRuntime();
if (wRuntime != null) {
wJson.add(IJsonKeys.COHORTE_VERSION, wRuntime.getVersion());
}
JsonObject wRunJs = wJson.build();
wJWriter.write(wRunJs);
InputStream wInStream = new ByteArrayInputStream(wBuffer.toString().getBytes());
wRun.create(wInStream, true, null);
}
}
| cohorte/cohorte-studio | org.cohorte.studio.eclipse.ui.node/src/org/cohorte/studio/eclipse/ui/node/project/CNodeContentManager.java | Java | epl-1.0 | 4,320 | 33.83871 | 114 | 0.73588 | false |
/**
* Copyright (c) 2014 - 2022 Frank Appel
* 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:
* Frank Appel - initial API and implementation
*/
package com.codeaffine.eclipse.swt.util;
import org.eclipse.swt.widgets.Display;
public class ActionScheduler {
private final Display display;
private final Runnable action;
public ActionScheduler( Display display, Runnable action ) {
this.display = display;
this.action = action;
}
public void schedule( int delay ) {
display.timerExec( delay, action );
}
}
| fappel/xiliary | com.codeaffine.eclipse.swt/src/com/codeaffine/eclipse/swt/util/ActionScheduler.java | Java | epl-1.0 | 753 | 25.892857 | 72 | 0.730412 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="cxxClass" />
<meta name="DC.Title" content="TScheduleSettings2" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-3446B400-3C31-35D6-B88F-C6D036940790" />
<title>
TScheduleSettings2
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api" />
<link rel="stylesheet" type="text/css" href="cxxref.css" />
</head>
<body class="cxxref" id="GUID-3446B400-3C31-35D6-B88F-C6D036940790">
<a name="GUID-3446B400-3C31-35D6-B88F-C6D036940790">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0;
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
</div>
<h1 class="topictitle1">
TScheduleSettings2 Class Reference
</h1>
<table class="signature">
<tr>
<td>
class TScheduleSettings2
</td>
</tr>
</table>
<div class="section">
</div>
<div class="section member-index">
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Attributes
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-70D2CD33-9F34-3C49-8BFC-8B205C4B3FD2">
iEntryCount
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
<a href="GUID-0B9C8884-6BFF-35E2-AA6F-E4057B85AFCF.html">
TName
</a>
</td>
<td>
<a href="#GUID-1B094273-A4D8-39C3-A255-FC3DFC42DF7D">
iName
</a>
</td>
</tr>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
</td>
<td>
<a href="#GUID-0FAF0766-CBF9-3CF7-8165-EED186A19C5F">
iPersists
</a>
</td>
</tr>
</tbody>
</table>
</div>
<h1 class="pageHeading topictitle1">
Member Data Documentation
</h1>
<div class="nested1" id="GUID-70D2CD33-9F34-3C49-8BFC-8B205C4B3FD2">
<a name="GUID-70D2CD33-9F34-3C49-8BFC-8B205C4B3FD2">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iEntryCount
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iEntryCount
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-1B094273-A4D8-39C3-A255-FC3DFC42DF7D">
<a name="GUID-1B094273-A4D8-39C3-A255-FC3DFC42DF7D">
<!-- -->
</a>
<h2 class="topictitle2">
TName
iName
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-0B9C8884-6BFF-35E2-AA6F-E4057B85AFCF.html">
TName
</a>
</td>
<td>
iName
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-0FAF0766-CBF9-3CF7-8165-EED186A19C5F">
<a name="GUID-0FAF0766-CBF9-3CF7-8165-EED186A19C5F">
<!-- -->
</a>
<h2 class="topictitle2">
TBool
iPersists
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TBool
</a>
</td>
<td>
iPersists
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-3446B400-3C31-35D6-B88F-C6D036940790.html | HTML | epl-1.0 | 5,391 | 26.510204 | 163 | 0.556298 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="cxxClass" />
<meta name="DC.Title" content="MAknTouchPaneObserver" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6" />
<title>
MAknTouchPaneObserver
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api" />
<link rel="stylesheet" type="text/css" href="cxxref.css" />
</head>
<body class="cxxref" id="GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6">
<a name="GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2518338 id2518347 id2420140 id2461157 id2461194 id2566633 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
</div>
<h1 class="topictitle1">
MAknTouchPaneObserver Class Reference
</h1>
<table class="signature">
<tr>
<td>
class MAknTouchPaneObserver
</td>
</tr>
</table>
<div class="section">
<div>
<p>
The
<a href="GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6.html#GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6">
MAknTouchPaneObserver
</a>
interface allows a touch pane observer to pick up changes in the size or position of the touch pane. Such events will be as a result of layout changes which cause an actual change in the touch pane rectangle.
</p>
</div>
</div>
<div class="section member-index">
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Member Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="code">
void
</td>
<td>
<a href="#GUID-77E284B2-9EF7-330A-A13F-3BCAE5CDDDB9">
HandleTouchPaneSizeChange
</a>
()
</td>
</tr>
</tbody>
</table>
</div>
<h1 class="pageHeading topictitle1">
Member Functions Documentation
</h1>
<div class="nested1" id="GUID-77E284B2-9EF7-330A-A13F-3BCAE5CDDDB9">
<a name="GUID-77E284B2-9EF7-330A-A13F-3BCAE5CDDDB9">
<!-- -->
</a>
<h2 class="topictitle2">
HandleTouchPaneSizeChange()
</h2>
<table class="signature">
<tr>
<td>
void
</td>
<td>
HandleTouchPaneSizeChange
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[pure virtual]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Handles a change in the size or position of touch pane. This function is called when touch pane changes its size or position.
</p>
</div>
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-90BA76BC-5A25-32B7-8A5C-7908879962A6.html | HTML | epl-1.0 | 4,487 | 29.951724 | 215 | 0.599955 | false |
//
// EnlargedImageViewController.h
// ProjectCrystalBlue-iOS
//
// Created by Ryan McGraw on 4/20/14.
// Copyright (c) 2014 Project Crystal Blue. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Sample.h"
#import "AbstractCloudLibraryObjectStore.h"
@interface EnlargedImageViewController : UIViewController<UIAlertViewDelegate>
{
__strong IBOutlet UIImageView *imgView;
}
@property(nonatomic) Sample* selectedSample;
@property (nonatomic, strong) AbstractCloudLibraryObjectStore *libraryObjectStore;
- (id)initWithSample:(Sample*)initSample
withLibrary:(AbstractCloudLibraryObjectStore*)initLibrary
withImage:(UIImage*)initImage
withDescription:(NSString*)initDescription;
@end
| SCCapstone/ProjectCrystalBlue-iOS | ProjectCrystalBlue-iOS/ProjectCrystalBlue-iOS/EnlargedImageViewController.h | C | epl-1.0 | 725 | 26.884615 | 82 | 0.765517 | false |
/**
* Copyright (c) 2010-2013, openHAB.org 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
*/
package org.openhab.io.habmin.services.events;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import org.atmosphere.annotation.Broadcast;
import org.atmosphere.annotation.Suspend;
import org.atmosphere.annotation.Suspend.SCOPE;
import org.atmosphere.cpr.AtmosphereConfig;
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.BroadcasterFactory;
import org.atmosphere.cpr.BroadcasterLifeCyclePolicyListener;
import org.atmosphere.cpr.HeaderConfig;
import org.atmosphere.jersey.JerseyBroadcaster;
import org.atmosphere.jersey.SuspendResponse;
import org.openhab.core.items.GenericItem;
import org.openhab.core.items.Item;
import org.openhab.core.items.ItemNotFoundException;
import org.openhab.core.items.StateChangeListener;
import org.openhab.core.types.State;
import org.openhab.io.habmin.HABminApplication;
import org.openhab.io.habmin.internal.resources.MediaTypeHelper;
import org.openhab.io.habmin.internal.resources.ResponseTypeHelper;
import org.openhab.ui.items.ItemUIRegistry;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.api.json.JSONWithPadding;
/**
* <p>
* This class acts as a REST resource for history data and provides different
* methods to interact with the, persistence store
*
* <p>
* The typical content types are plain text for status values and XML or JSON(P)
* for more complex data structures
* </p>
*
* <p>
* This resource is registered with the Jersey servlet.
* </p>
*
* @author Chris Jackson
* @since 1.3.0
*/
@Path(EventResource.PATH_EVENTS)
public class EventResource {
private static final Logger logger = LoggerFactory.getLogger(EventResource.class);
/** The URI path to this resource */
public static final String PATH_EVENTS = "events";
/*
@Context
UriInfo uriInfo;
@Suspend(contentType = "application/json")
@GET
public String suspend() {
return "";
}
@Broadcast(writeEntity = false)
@GET
@Produces({ MediaType.WILDCARD })
public SuspendResponse<Response> getItems(@Context HttpHeaders headers,
@HeaderParam(HeaderConfig.X_ATMOSPHERE_TRANSPORT) String atmosphereTransport,
@HeaderParam(HeaderConfig.X_CACHE_DATE) long cacheDate, @QueryParam("type") String type,
@QueryParam("jsoncallback") @DefaultValue("callback") String callback, @Context AtmosphereResource resource) {
logger.debug("Received HTTP GET request at '{}' for media type '{}'.", uriInfo.getPath(), type);
String responseType = MediaTypeHelper.getResponseMediaType(headers.getAcceptableMediaTypes(), type);
if (atmosphereTransport == null || atmosphereTransport.isEmpty()) {
// first request => return all values
// if (responseType != null) {
// throw new WebApplicationException(Response.ok(
// getItemStateListBean(itemNames, System.currentTimeMillis()),
// responseType).build());
// } else {
throw new WebApplicationException(Response.notAcceptable(null).build());
// }
}
String p = resource.getRequest().getPathInfo();
EventBroadcaster broadcaster = (EventBroadcaster) BroadcasterFactory.getDefault().lookup(
EventBroadcaster.class, p, true);
broadcaster.register();
// itemBroadcaster.addStateChangeListener(new
// ItemStateChangeListener(itemNames));
return new SuspendResponse.SuspendResponseBuilder<Response>().scope(SCOPE.REQUEST)
.resumeOnBroadcast(!ResponseTypeHelper.isStreamingTransport(resource.getRequest()))
.broadcaster(broadcaster).outputComments(true).build();
}
*/
/*
* @GET
*
* @Path("/{bundlename: [a-zA-Z_0-9]*}")
*
* @Produces({ MediaType.WILDCARD }) public SuspendResponse<Response>
* getItemData(@Context HttpHeaders headers, @PathParam("bundlename") String
* bundlename,
*
* @QueryParam("type") String type, @QueryParam("jsoncallback")
*
* @DefaultValue("callback") String callback,
*
* @HeaderParam(HeaderConfig.X_ATMOSPHERE_TRANSPORT) String
* atmosphereTransport,
*
* @Context AtmosphereResource resource) {
* logger.debug("Received HTTP GET request at '{}' for media type '{}'.",
* uriInfo.getPath(), type );
*
* if (atmosphereTransport == null || atmosphereTransport.isEmpty()) { final
* String responseType =
* MediaTypeHelper.getResponseMediaType(headers.getAcceptableMediaTypes(),
* type); if (responseType != null) { final Object responseObject =
* responseType.equals(MediaTypeHelper.APPLICATION_X_JAVASCRIPT) ? new
* JSONWithPadding( getBundleBean(bundlename, true), callback) :
* getBundleBean(bundlename, true); throw new
* WebApplicationException(Response.ok(responseObject,
* responseType).build()); } else { throw new
* WebApplicationException(Response.notAcceptable(null).build()); } }
* GeneralBroadcaster itemBroadcaster = (GeneralBroadcaster)
* BroadcasterFactory.getDefault().lookup( GeneralBroadcaster.class,
* resource.getRequest().getPathInfo(), true); return new
* SuspendResponse.SuspendResponseBuilder<Response>().scope(SCOPE.REQUEST)
* .resumeOnBroadcast
* (!ResponseTypeHelper.isStreamingTransport(resource.getRequest()))
* .broadcaster(itemBroadcaster).outputComments(true).build(); }
*
* public static BundleBean createBundleBean(Bundle bundle, String uriPath,
* boolean detail) { BundleBean bean = new BundleBean();
*
* bean.name = bundle.getSymbolicName(); bean.version =
* bundle.getVersion().toString(); bean.modified = bundle.getLastModified();
* bean.id = bundle.getBundleId(); bean.state = bundle.getState(); bean.link
* = uriPath;
*
* return bean; }
*
* static public Item getBundle(String itemname, String uriPath) {
* ItemUIRegistry registry = HABminApplication.getItemUIRegistry(); if
* (registry != null) { try { Item item = registry.getItem(itemname); return
* item; } catch (ItemNotFoundException e) { logger.debug(e.getMessage()); }
* } return null; }
*
* private ItemBean getBundleBean(String bundlename, String uriPath) {
*
* Item item = getItem(itemname); if (item != null) { return
* createBundleBean(item, uriInfo.getBaseUri().toASCIIString(), true); }
* else {
* logger.info("Received HTTP GET request at '{}' for the unknown item '{}'."
* , uriInfo.getPath(), itemname); throw new WebApplicationException(404); }
* }
*
* private List<BundleBean> getBundles(String uriPath) { List<BundleBean>
* beans = new LinkedList<BundleBean>();
*
* BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass())
* .getBundleContext();
*
* for (Bundle bundle : bundleContext.getBundles()) {
* logger.info(bundle.toString()); BundleBean bean =
* (BundleBean)createBundleBean(bundle, uriPath, false);
*
* if(bean != null) beans.add(bean); } return beans; }
*/
}
| jenskastensson/openhab | bundles/io/org.openhab.io.habmin/src/main/java/org/openhab/io/habmin/services/events/EventResource.java | Java | epl-1.0 | 7,435 | 37.128205 | 113 | 0.742972 | false |
/*******************************************************************************
* Copyright (c) 2014 Pivotal Software, Inc.
* 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:
* Pivotal Software, Inc. - initial API and implementation
*******************************************************************************/
package org.springsource.ide.eclipse.gradle.core.modelmanager;
import org.eclipse.core.runtime.IProgressMonitor;
import org.springsource.ide.eclipse.gradle.core.GradleProject;
/**
* Interface that hides the mechanics of how models are being built via Gradle's tooling API (or whatever way
* models are being built). To implement a ModelBuilder create a subclass of AbstractModelBuilder
*/
public interface ModelBuilder {
public <T> BuildResult<T> buildModel(GradleProject project, Class<T> type, final IProgressMonitor mon);
} | oxmcvusd/eclipse-integration-gradle | org.springsource.ide.eclipse.gradle.core/src/org/springsource/ide/eclipse/gradle/core/modelmanager/ModelBuilder.java | Java | epl-1.0 | 1,069 | 43.583333 | 109 | 0.663237 | false |
/*******************************************************************************
"FreePastry" Peer-to-Peer Application Development Substrate
Copyright 2002-2007, Rice University. Copyright 2006-2007, Max Planck Institute
for Software Systems. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Rice University (RICE), Max Planck Institute for Software
Systems (MPI-SWS) nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
permission.
This software is provided by RICE, MPI-SWS and the contributors on an "as is"
basis, without any representations or warranties of any kind, express or implied
including, but not limited to, representations or warranties of
non-infringement, merchantability or fitness for a particular purpose. In no
event shall RICE, MPI-SWS or contributors be liable for any direct, indirect,
incidental, special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including negligence
or otherwise) arising in any way out of the use of this software, even if
advised of the possibility of such damage.
*******************************************************************************/
package org.mpisws.p2p.transport.peerreview.commitment;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.SignatureException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.mpisws.p2p.transport.MessageCallback;
import org.mpisws.p2p.transport.MessageRequestHandle;
import org.mpisws.p2p.transport.peerreview.PeerReview;
import org.mpisws.p2p.transport.peerreview.PeerReviewConstants;
import org.mpisws.p2p.transport.peerreview.history.HashSeq;
import org.mpisws.p2p.transport.peerreview.history.IndexEntry;
import org.mpisws.p2p.transport.peerreview.history.SecureHistory;
import org.mpisws.p2p.transport.peerreview.history.logentry.EvtAck;
import org.mpisws.p2p.transport.peerreview.history.logentry.EvtRecv;
import org.mpisws.p2p.transport.peerreview.history.logentry.EvtSend;
import org.mpisws.p2p.transport.peerreview.history.logentry.EvtSign;
import org.mpisws.p2p.transport.peerreview.identity.IdentityTransport;
import org.mpisws.p2p.transport.peerreview.infostore.PeerInfoStore;
import org.mpisws.p2p.transport.peerreview.message.AckMessage;
import org.mpisws.p2p.transport.peerreview.message.OutgoingUserDataMessage;
import org.mpisws.p2p.transport.peerreview.message.UserDataMessage;
import org.mpisws.p2p.transport.util.MessageRequestHandleImpl;
import rice.environment.logging.Logger;
import rice.p2p.commonapi.rawserialization.RawSerializable;
import rice.p2p.util.MathUtils;
import rice.p2p.util.rawserialization.SimpleInputBuffer;
import rice.p2p.util.tuples.Tuple;
import rice.selector.TimerTask;
public class CommitmentProtocolImpl<Handle extends RawSerializable, Identifier extends RawSerializable> implements
CommitmentProtocol<Handle, Identifier>, PeerReviewConstants {
public int MAX_PEERS = 250;
public int INITIAL_TIMEOUT_MILLIS = 1000;
public int RETRANSMIT_TIMEOUT_MILLIS = 1000;
public int RECEIVE_CACHE_SIZE = 100;
public int MAX_RETRANSMISSIONS = 2;
public int TI_PROGRESS = 1;
public int PROGRESS_INTERVAL_MILLIS = 1000;
public int MAX_ENTRIES_PER_MS = 1000000; /* Max number of entries per millisecond */
/**
* We need to keep some state for each peer, including separate transmit and
* receive queues
*/
Map<Identifier, PeerInfo<Handle>> peer = new HashMap<Identifier, PeerInfo<Handle>>();
/**
* We cache a few recently received messages, so we can recognize duplicates.
* We also remember the location of the corresponding RECV entry in the log,
* so we can reproduce the matching acknowledgment
*/
Map<Tuple<Identifier, Long>, ReceiveInfo<Identifier>> receiveCache;
AuthenticatorStore<Identifier> authStore;
SecureHistory history;
PeerReview<Handle, Identifier> peerreview;
PeerInfoStore<Handle, Identifier> infoStore;
IdentityTransport<Handle, Identifier> transport;
/**
* If the time is more different than this from a peer, we discard the message
*/
long timeToleranceMillis;
int nextReceiveCacheEntry;
int signatureSizeBytes;
int hashSizeBytes;
TimerTask makeProgressTask;
Logger logger;
public CommitmentProtocolImpl(PeerReview<Handle,Identifier> peerreview,
IdentityTransport<Handle, Identifier> transport,
PeerInfoStore<Handle, Identifier> infoStore, AuthenticatorStore<Identifier> authStore,
SecureHistory history,
long timeToleranceMillis) throws IOException {
this.peerreview = peerreview;
this.transport = transport;
this.infoStore = infoStore;
this.authStore = authStore;
this.history = history;
this.nextReceiveCacheEntry = 0;
// this.numPeers = 0;
this.timeToleranceMillis = timeToleranceMillis;
this.logger = peerreview.getEnvironment().getLogManager().getLogger(CommitmentProtocolImpl.class, null);
initReceiveCache();
makeProgressTask = new TimerTask(){
@Override
public void run() {
makeProgressAllPeers();
}
};
peerreview.getEnvironment().getSelectorManager().schedule(makeProgressTask, PROGRESS_INTERVAL_MILLIS, PROGRESS_INTERVAL_MILLIS);
}
/**
* Load the last events from the history into the cache
*/
protected void initReceiveCache() throws IOException {
receiveCache = new LinkedHashMap<Tuple<Identifier, Long>, ReceiveInfo<Identifier>>(RECEIVE_CACHE_SIZE, 0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > RECEIVE_CACHE_SIZE;
}
};
for (long i=history.getNumEntries()-1; (i>=1) && (receiveCache.size() < RECEIVE_CACHE_SIZE); i--) {
IndexEntry hIndex = history.statEntry(i);
if (hIndex.getType() == PeerReviewConstants.EVT_RECV) {
// NOTE: this could be more efficient, because we don't need the whole thing
SimpleInputBuffer sib = new SimpleInputBuffer(history.getEntry(hIndex, hIndex.getSizeInFile()));
Identifier thisSender = peerreview.getIdSerializer().deserialize(sib);
// NOTE: the message better start with the sender seq, but this is done within this protocol
addToReceiveCache(thisSender, sib.readLong(), i);
}
}
}
protected void addToReceiveCache(Identifier id, long senderSeq, long indexInLocalHistory) {
receiveCache.put(new Tuple<Identifier, Long>(id,senderSeq), new ReceiveInfo<Identifier>(id, senderSeq, indexInLocalHistory));
}
protected PeerInfo<Handle> lookupPeer(Handle handle) {
PeerInfo<Handle> ret = peer.get(peerreview.getIdentifierExtractor().extractIdentifier(handle));
if (ret != null) return ret;
ret = new PeerInfo<Handle>(handle);
peer.put(peerreview.getIdentifierExtractor().extractIdentifier(handle), ret);
return ret;
}
@Override
public void notifyCertificateAvailable(Identifier id) {
makeProgress(id);
}
/**
* Checks whether an incoming message is already in the log (which can happen with duplicates).
* If not, it adds the message to the log.
* @return The ack message and whether it was already logged.
* @throws SignatureException
*/
@Override
public Tuple<AckMessage<Identifier>,Boolean> logMessageIfNew(UserDataMessage<Handle> udm) {
try {
boolean loggedPreviously; // part of the return statement
long seqOfRecvEntry;
byte[] myHashTop;
byte[] myHashTopMinusOne;
// SimpleInputBuffer sib = new SimpleInputBuffer(message);
// UserDataMessage<Handle> udm = UserDataMessage.build(sib, peerreview.getHandleSerializer(), peerreview.getHashSizeInBytes(), peerreview.getSignatureSizeInBytes());
/* Check whether the log contains a matching RECV entry, i.e. one with a message
from the same node and with the same send sequence number */
long indexOfRecvEntry = findRecvEntry(peerreview.getIdentifierExtractor().extractIdentifier(udm.getSenderHandle()), udm.getTopSeq());
/* If there is no such RECV entry, we append one */
if (indexOfRecvEntry < 0L) {
/* Construct the RECV entry and append it to the log */
myHashTopMinusOne = history.getTopLevelEntry().getHash();
EvtRecv<Handle> recv = udm.getReceiveEvent(transport);
history.appendEntry(EVT_RECV, true, recv.serialize());
HashSeq foo = history.getTopLevelEntry();
myHashTop = foo.getHash();
seqOfRecvEntry = foo.getSeq();
addToReceiveCache(peerreview.getIdentifierExtractor().extractIdentifier(udm.getSenderHandle()),
udm.getTopSeq(), history.getNumEntries() - 1);
if (logger.level < Logger.FINE) logger.log("New message logged as seq#"+seqOfRecvEntry);
/* Construct the SIGN entry and append it to the log */
history.appendEntry(EVT_SIGN, true, new EvtSign(udm.getHTopMinusOne(),udm.getSignature()).serialize());
loggedPreviously = false;
} else {
loggedPreviously = true;
/* If the RECV entry already exists, retrieve it */
// unsigned char type;
// bool ok = true;
IndexEntry i2 = history.statEntry(indexOfRecvEntry); //, &seqOfRecvEntry, &type, NULL, NULL, myHashTop);
IndexEntry i1 = history.statEntry(indexOfRecvEntry-1); //, NULL, NULL, NULL, NULL, myHashTopMinusOne);
assert(i1 != null && i2 != null && i2.getType() == EVT_RECV) : "i1:"+i1+" i2:"+i2;
seqOfRecvEntry = i2.getSeq();
myHashTop = i2.getNodeHash();
myHashTopMinusOne = i1.getNodeHash();
if (logger.level < Logger.FINE) logger.log("This message has already been logged as seq#"+seqOfRecvEntry);
}
/* Generate ACK = (MSG_ACK, myID, remoteSeq, localSeq, myTopMinusOne, signature) */
byte[] hToSign = transport.hash(ByteBuffer.wrap(MathUtils.longToByteArray(seqOfRecvEntry)), ByteBuffer.wrap(myHashTop));
AckMessage<Identifier> ack = new AckMessage<Identifier>(
peerreview.getLocalId(),
udm.getTopSeq(),
seqOfRecvEntry,
myHashTopMinusOne,
transport.sign(hToSign));
return new Tuple<AckMessage<Identifier>,Boolean>(ack, loggedPreviously);
} catch (IOException ioe) {
RuntimeException throwMe = new RuntimeException("Unexpect error logging message :"+udm);
throwMe.initCause(ioe);
throw throwMe;
}
}
@Override
public void notifyStatusChange(Identifier id, int newStatus) {
makeProgressAllPeers();
}
protected void makeProgressAllPeers() {
for (Identifier i : peer.keySet()) {
makeProgress(i);
}
}
/**
* Tries to make progress on the message queue of the specified peer, e.g. after that peer
* has become TRUSTED, or after it has sent us an acknowledgment
*/
protected void makeProgress(Identifier idx) {
// logger.log("makeProgress("+idx+")");
PeerInfo<Handle> info = peer.get(idx);
if (info == null || (info.xmitQueue.isEmpty() && info.recvQueue.isEmpty())) {
return;
}
/* Get the public key. If we don't have it (yet), ask the peer to send it */
if (!transport.hasCertificate(idx)) {
peerreview.requestCertificate(info.handle, idx);
return;
}
/* Transmit queue: If the peer is suspected, challenge it; otherwise, send the next message
or retransmit the one currently in flight */
if (!info.xmitQueue.isEmpty()) {
int status = infoStore.getStatus(idx);
switch (status) {
case STATUS_EXPOSED: /* Node is already exposed; no point in sending it any further messages */
if (logger.level <= Logger.WARNING) logger.log("Releasing messages sent to exposed node "+idx);
info.clearXmitQueue();
return;
case STATUS_SUSPECTED: /* Node is suspected; send the first unanswered challenge */
if (info.lastChallenge < (peerreview.getTime() - info.currentChallengeInterval)) {
if (logger.level <= Logger.WARNING) logger.log(
"Pending message for SUSPECTED node "+info.getHandle()+"; challenging node (interval="+info.currentChallengeInterval+")");
info.lastChallenge = peerreview.getTime();
info.currentChallengeInterval *= 2;
peerreview.challengeSuspectedNode(info.handle);
}
return;
case STATUS_TRUSTED: /* Node is trusted; continue below */
info.lastChallenge = -1;
info.currentChallengeInterval = PeerInfo.INITIAL_CHALLENGE_INTERVAL_MICROS;
break;
}
/* If there are no unacknowledged packets to that node, transmit the next packet */
if (info.numOutstandingPackets == 0) {
info.numOutstandingPackets++;
info.lastTransmit = peerreview.getTime();
info.currentTimeout = INITIAL_TIMEOUT_MILLIS;
info.retransmitsSoFar = 0;
OutgoingUserDataMessage<Handle> oudm = info.xmitQueue.getFirst();
// try {
peerreview.transmit(info.getHandle(), oudm, null, oudm.getOptions());
// } catch (IOException ioe) {
// info.xmitQueue.removeFirst();
// oudm.sendFailed(ioe);
// return;
// }
} else if (peerreview.getTime() > (info.lastTransmit + info.currentTimeout)) {
/* Otherwise, retransmit the current packet a few times, up to the specified limit */
if (info.retransmitsSoFar < MAX_RETRANSMISSIONS) {
if (logger.level <= Logger.WARNING) logger.log(
"Retransmitting a "+info.xmitQueue.getFirst().getPayload().remaining()+"-byte message to "+info.getHandle()+
" (lastxmit="+info.lastTransmit+", timeout="+info.currentTimeout+", type="+
info.xmitQueue.getFirst().getType()+")");
info.retransmitsSoFar++;
info.currentTimeout = RETRANSMIT_TIMEOUT_MILLIS;
info.lastTransmit = peerreview.getTime();
OutgoingUserDataMessage<Handle> oudm = info.xmitQueue.getFirst();
// try {
peerreview.transmit(info.handle, oudm, null, oudm.getOptions());
// } catch (IOException ioe) {
// info.xmitQueue.removeFirst();
// oudm.sendFailed(ioe);
// return;
// }
} else {
/* If the peer still won't acknowledge the message, file a SEND challenge with its witnesses */
if (logger.level <= Logger.WARNING) logger.log(info.handle+
" has not acknowledged our message after "+info.retransmitsSoFar+
" retransmissions; filing as evidence");
OutgoingUserDataMessage<Handle> challenge = info.xmitQueue.removeFirst();
challenge.sendFailed(new IOException("Peer Review Giving Up sending message to "+idx));
long evidenceSeq = peerreview.getEvidenceSeq();
try {
infoStore.addEvidence(peerreview.getLocalId(),
peerreview.getIdentifierExtractor().extractIdentifier(info.handle),
evidenceSeq, challenge, null);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
peerreview.sendEvidenceToWitnesses(peerreview.getIdentifierExtractor().extractIdentifier(info.handle),
evidenceSeq, challenge);
info.numOutstandingPackets --;
}
}
}
/* Receive queue */
if (!info.recvQueue.isEmpty() && !info.isReceiving) {
info.isReceiving = true;
/* Dequeue the packet. After this point, we must either deliver it or discard it */
Tuple<UserDataMessage<Handle>, Map<String, Object>> t = info.recvQueue.removeFirst();
UserDataMessage<Handle> udm = t.a();
/* Extract the authenticator */
Authenticator authenticator;
byte[] innerHash = udm.getInnerHash(peerreview.getLocalId(), transport);
authenticator = peerreview.extractAuthenticator(
peerreview.getIdentifierExtractor().extractIdentifier(udm.getSenderHandle()),
udm.getTopSeq(),
EVT_SEND,
innerHash, udm.getHTopMinusOne(), udm.getSignature());
// logger.log("received message, extract auth from "+udm.getSenderHandle()+" seq:"+udm.getTopSeq()+" "+
// MathUtils.toBase64(innerHash)+" htop-1:"+MathUtils.toBase64(udm.getHTopMinusOne())+" sig:"+MathUtils.toBase64(udm.getSignature()));
if (authenticator != null) {
/* At this point, we are convinced that:
- The remote node is TRUSTED [TODO!!]
- The message has an acceptable sequence number
- The message is properly signed
Now we must check our log for an existing RECV entry:
- If we already have such an entry, we generate the ACK from there
- If we do not yet have the entry, we log the message and deliver it */
Tuple<AckMessage<Identifier>, Boolean> ret = logMessageIfNew(udm);
/* Since the message is not yet in the log, deliver it to the application */
if (!ret.b()) {
if (logger.level <= Logger.FINE) logger.log(
"Delivering message from "+udm.getSenderHandle()+" via "+info.handle+" ("+
udm.getPayloadLen()+" bytes; "+udm.getRelevantLen()+"/"+udm.getPayloadLen()+" relevant)");
try {
peerreview.getApp().messageReceived(udm.getSenderHandle(), udm.getPayload(), t.b());
} catch (IOException ioe) {
logger.logException("Error handling "+udm, ioe);
}
} else {
if (logger.level <= Logger.FINE) logger.log(
"Message from "+udm.getSenderHandle()+" via "+info.getHandle()+" was previously logged; not delivered");
}
/* Send the ACK */
if (logger.level <= Logger.FINE) logger.log("Returning ACK to"+info.getHandle());
// try {
peerreview.transmit(info.handle, ret.a(), null, t.b());
// } catch (IOException ioe) {
// throw new RuntimeException("Major problem, ack couldn't be serialized." +ret.a(),ioe);
// }
} else {
if (logger.level <= Logger.WARNING) logger.log("Cannot verify signature on message "+udm.getTopSeq()+" from "+info.getHandle()+"; discarding");
}
/* Release the message */
info.isReceiving = false;
makeProgress(idx);
}
}
protected long findRecvEntry(Identifier id, long seq) {
ReceiveInfo<Identifier> ret = receiveCache.get(new Tuple<Identifier, Long>(id,seq));
if (ret == null) return -1;
return ret.indexInLocalHistory;
}
protected long findAckEntry(Identifier id, long seq) {
return -1;
}
/**
* Handle an incoming USERDATA message
*/
@Override
public void handleIncomingMessage(Handle source, UserDataMessage<Handle> msg, Map<String, Object> options) throws IOException {
// char buf1[256];
/* Check whether the timestamp (in the sequence number) is close enough to our local time.
If not, the node may be trying to roll forward its clock, so we discard the message. */
long txmit = (msg.getTopSeq() / MAX_ENTRIES_PER_MS);
if ((txmit < (peerreview.getTime()-timeToleranceMillis)) || (txmit > (peerreview.getTime()+timeToleranceMillis))) {
if (logger.level <= Logger.WARNING) logger.log("Invalid sequence no #"+msg.getTopSeq()+" on incoming message (dt="+(txmit-peerreview.getTime())+"); discarding");
return;
}
/**
* Append a copy of the message to our receive queue. If the node is
* trusted, the message is going to be delivered directly by makeProgress();
* otherwise a challenge is sent.
*/
lookupPeer(source).recvQueue.addLast(new Tuple<UserDataMessage<Handle>, Map<String,Object>>(msg,options));
makeProgress(peerreview.getIdentifierExtractor().extractIdentifier(source));
}
@Override
public MessageRequestHandle<Handle, ByteBuffer> handleOutgoingMessage(
final Handle target, final ByteBuffer message,
MessageCallback<Handle, ByteBuffer> deliverAckToMe,
final Map<String, Object> options) {
int relevantlen = message.remaining();
if (options != null && options.containsKey(PeerReview.RELEVANT_LENGTH)) {
Number n = (Number)options.get(PeerReview.RELEVANT_LENGTH);
relevantlen = n.intValue();
}
assert(relevantlen >= 0);
/* Append a SEND entry to our local log */
byte[] hTopMinusOne, hTop, hToSign;
// long topSeq;
hTopMinusOne = history.getTopLevelEntry().getHash();
EvtSend<Identifier> evtSend;
if (relevantlen < message.remaining()) {
evtSend = new EvtSend<Identifier>(peerreview.getIdentifierExtractor().extractIdentifier(target),message,relevantlen,transport);
} else {
evtSend = new EvtSend<Identifier>(peerreview.getIdentifierExtractor().extractIdentifier(target),message);
}
try {
// logger.log("XXXa "+Arrays.toString(evtSend.serialize().array()));
history.appendEntry(evtSend.getType(), true, evtSend.serialize());
} catch (IOException ioe) {
MessageRequestHandle<Handle, ByteBuffer> ret = new MessageRequestHandleImpl<Handle, ByteBuffer>(target,message,options);
if (deliverAckToMe != null) deliverAckToMe.sendFailed(ret, ioe);
return ret;
}
// hTop, &topSeq
HashSeq top = history.getTopLevelEntry();
/* Sign the authenticator */
// logger.log("about to sign: "+top.getSeq()+" "+MathUtils.toBase64(top.getHash()));
hToSign = transport.hash(ByteBuffer.wrap(MathUtils.longToByteArray(top.getSeq())), ByteBuffer.wrap(top.getHash()));
byte[] signature = transport.sign(hToSign);
/* Append a SENDSIGN entry */
ByteBuffer relevantMsg = message;
if (relevantlen < message.remaining()) {
relevantMsg = ByteBuffer.wrap(message.array(), message.position(), relevantlen);
} else {
relevantMsg = ByteBuffer.wrap(message.array(), message.position(), message.remaining());
}
try {
history.appendEntry(EVT_SENDSIGN, true, relevantMsg, ByteBuffer.wrap(signature));
} catch (IOException ioe) {
MessageRequestHandle<Handle, ByteBuffer> ret = new MessageRequestHandleImpl<Handle, ByteBuffer>(target,message,options);
if (deliverAckToMe != null) deliverAckToMe.sendFailed(ret, ioe);
return ret;
}
/* Construct a USERDATA message... */
assert((relevantlen == message.remaining()) || (relevantlen < 255));
PeerInfo<Handle> pi = lookupPeer(target);
OutgoingUserDataMessage<Handle> udm = new OutgoingUserDataMessage<Handle>(top.getSeq(), peerreview.getLocalHandle(), hTopMinusOne, signature, message, relevantlen, options, pi, deliverAckToMe);
/* ... and put it into the send queue. If the node is trusted and does not have any
unacknowledged messages, makeProgress() will simply send it out. */
pi.xmitQueue.addLast(udm);
makeProgress(peerreview.getIdentifierExtractor().extractIdentifier(target));
return udm;
}
/* This is called if we receive an acknowledgment from another node */
@Override
public void handleIncomingAck(Handle source, AckMessage<Identifier> ackMessage, Map<String, Object> options) throws IOException {
// AckMessage<Identifier> ackMessage = AckMessage.build(sib, peerreview.getIdSerializer(), hasher.getHashSizeBytes(), transport.signatureSizeInBytes());
/* Acknowledgment: Log it (if we don't have it already) and send the next message, if any */
if (logger.level <= Logger.FINE) logger.log("Received an ACK from "+source);
// TODO: check that ackMessage came from the source
if (transport.hasCertificate(ackMessage.getNodeId())) {
PeerInfo<Handle> p = lookupPeer(source);
boolean checkAck = true;
OutgoingUserDataMessage<Handle> udm = null;
if (p.xmitQueue.isEmpty()) {
checkAck = false; // don't know why this happens, but maybe the ACK gets duplicated somehow
} else {
udm = p.xmitQueue.getFirst();
}
/* The ACK must acknowledge the sequence number of the packet that is currently
at the head of the send queue */
if (checkAck && ackMessage.getSendEntrySeq() == udm.getTopSeq()) {
/* Now we're ready to check the signature */
/* The peer will have logged a RECV entry, and the signature is calculated over that
entry. To verify the signature, we must reconstruct that RECV entry locally */
byte[] innerHash = udm.getInnerHash(transport);
Authenticator authenticator = peerreview.extractAuthenticator(
ackMessage.getNodeId(), ackMessage.getRecvEntrySeq(), EVT_RECV, innerHash,
ackMessage.getHashTopMinusOne(), ackMessage.getSignature());
if (authenticator != null) {
/* Signature is okay... append an ACK entry to the log */
if (logger.level <= Logger.FINE) logger.log("ACK is okay; logging "+ackMessage);
EvtAck<Identifier> evtAck = new EvtAck<Identifier>(ackMessage.getNodeId(), ackMessage.getSendEntrySeq(), ackMessage.getRecvEntrySeq(), ackMessage.getHashTopMinusOne(), ackMessage.getSignature());
history.appendEntry(EVT_ACK, true, evtAck.serialize());
udm.sendComplete(); //ackMessage.getSendEntrySeq());
/* Remove the message from the xmit queue */
p.xmitQueue.removeFirst();
p.numOutstandingPackets--;
/* Make progress (e.g. by sending the next message) */
makeProgress(peerreview.getIdentifierExtractor().extractIdentifier(p.getHandle()));
} else {
if (logger.level <= Logger.WARNING) logger.log("Invalid ACK from <"+ackMessage.getNodeId()+">; discarding");
}
} else {
if (findAckEntry(ackMessage.getNodeId(), ackMessage.getSendEntrySeq()) < 0) {
if (logger.level <= Logger.WARNING) logger.log("<"+ackMessage.getNodeId()+"> has ACKed something we haven't sent ("+ackMessage.getSendEntrySeq()+"); discarding");
} else {
if (logger.level <= Logger.WARNING) logger.log("Duplicate ACK from <"+ackMessage.getNodeId()+">; discarding");
}
}
} else {
if (logger.level <= Logger.WARNING) logger.log("We got an ACK from <"+ackMessage.getNodeId()+">, but we don't have the certificate; discarding");
}
}
@Override
public void setTimeToleranceMillis(long timeToleranceMillis) {
this.timeToleranceMillis = timeToleranceMillis;
}
}
| michele-loreti/jResp | core/org.cmg.jresp.pastry/pastry-2.1/src/org/mpisws/p2p/transport/peerreview/commitment/CommitmentProtocolImpl.java | Java | epl-1.0 | 27,337 | 42.461049 | 205 | 0.676007 | false |
if (NABUCCO === undefined || !NABUCCO)
{
var NABUCCO = {};
}
(function()
{
NABUCCO.component = NABUCCO.component || {};
NABUCCO.component.CMISDocumentList = function(htmlId)
{
// replace Bubbling.on with NO-OP, so the superclass can't register its event listeners (never-ever)
var on = YAHOO.Bubbling.on;
YAHOO.Bubbling.on = function()
{
// NO-OP
return;
};
try
{
NABUCCO.component.CMISDocumentList.superclass.constructor.call(this, htmlId);
// restore
YAHOO.Bubbling.on = on;
}
catch (e)
{
// restore
YAHOO.Bubbling.on = on;
throw e;
}
this.name = "NABUCCO.component.CMISDocumentList";
Alfresco.util.ComponentManager.reregister(this);
this.dataSourceUrl = Alfresco.constants.URL_SERVICECONTEXT + 'nabucco/components/cmis-documentlist/data?';
if (htmlId !== "null")
{
// we actually want to react to metadataRefresh
YAHOO.Bubbling.on("metadataRefresh", this.onDocListRefresh, this);
YAHOO.Bubbling.on("filterChanged", this.onFilterChanged, this);
YAHOO.Bubbling.on("changeFilter", this.onChangeFilter, this);
}
this.dragAndDropAllowed = false;
this.setOptions(
{
preferencePrefix : "org.nabucco.cmis-documentlibrary"
});
};
YAHOO.extend(NABUCCO.component.CMISDocumentList, Alfresco.DocumentList,
{
onSortAscending : function()
{
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride.call(this,
NABUCCO.component.CMISDocumentList.superclass.onSortAscending, arguments);
},
onSortField : function()
{
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride.call(this,
NABUCCO.component.CMISDocumentList.superclass.onSortField, arguments);
},
onShowFolders : function()
{
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride.call(this,
NABUCCO.component.CMISDocumentList.superclass.onShowFolders, arguments);
},
onViewRendererSelect : function()
{
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride.call(this,
NABUCCO.component.CMISDocumentList.superclass.onViewRendererSelect, arguments);
},
onSimpleDetailed : function()
{
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride.call(this,
NABUCCO.component.CMISDocumentList.superclass.onSimpleDetailed, arguments);
},
_buildDocListParams : function(p_obj)
{
var params = "", obj =
{
path : this.currentPath
};
// Pagination in use?
if (this.options.usePagination)
{
obj.page = this.widgets.paginator.getCurrentPage() || this.currentPage;
obj.pageSize = this.widgets.paginator.getRowsPerPage();
}
// Passed-in overrides
if (typeof p_obj === "object")
{
obj = YAHOO.lang.merge(obj, p_obj);
}
params = "path=" + obj.path;
// Paging parameters
if (this.options.usePagination)
{
params += "&pageSize=" + obj.pageSize + "&pos=" + obj.page;
}
// Sort parameters
params += "&sortAsc=" + this.options.sortAscending + "&sortField=" + encodeURIComponent(this.options.sortField);
// View mode and No-cache
params += "&view=" + this.actionsView + "&noCache=" + new Date().getTime();
return params;
}
});
NABUCCO.component.CMISDocumentList.withPreferencePrefixOverride = function(callback, args)
{
var prefSet, result, scope = this;
if (YAHOO.lang.isString(this.options.preferencePrefix) && this.options.preferencePrefix !== "org.alfresco.share.documentList")
{
prefSet = this.services.preferences.set;
this.services.preferences.set = function(prefKey, value, responseConfig)
{
prefKey = prefKey.replace("org.alfresco.share.documentList.", scope.options.preferencePrefix + '.');
return prefSet.call(this, prefKey, value, responseConfig);
};
try
{
result = callback.apply(this, args);
this.services.preferences.set = prefSet;
}
catch (e)
{
this.services.preferences.set = prefSet;
throw e;
}
return result;
}
return callback.apply(this, args);
};
// necessary to fix default thumbnail icons for non-standard node types, especially non-file-folder types
NABUCCO.component.CMISDocumentList.withFileIconOverride = function(callback, args)
{
var getFileIcon = Alfresco.util.getFileIcon, node = args[1].getData().jsNode, result;
Alfresco.util.getFileIcon = function(p_fileName, p_fileType, p_iconSize, p_fileParentType)
{
if (p_fileType === undefined)
{
if (node.isLink && YAHOO.lang.isObject(node.linkedNode) && YAHOO.lang.isString(node.linkedNode.type))
{
p_fileType = node.linkedNode.type;
}
else
{
p_fileType = node.type;
}
}
return getFileIcon.call(Alfresco.util, p_fileName, p_fileType, p_iconSize, p_fileParentType);
};
Alfresco.util.getFileIcon.types = getFileIcon.types;
try
{
result = callback.apply(this, args);
Alfresco.util.getFileIcon = getFileIcon;
}
catch (e)
{
Alfresco.util.getFileIcon = getFileIcon;
throw e;
}
return result;
};
// necessary to fix thumbnail URL generation to avoid HTTP 400 responses for attempts on items without content
NABUCCO.component.CMISDocumentList.withThumbnailOverride = function(callback, args)
{
var generateThumbnailUrl = Alfresco.DocumentList.generateThumbnailUrl, result;
Alfresco.DocumentList.generateThumbnailUrl = function(record)
{
var node = record.jsNode;
if ((node.isContent || (node.isLink && node.linkedNode.isContent))
&& (YAHOO.lang.isString(node.contentURL) || (node.isLink && YAHOO.lang.isString(node.linkedNode.contentURL))))
{
return generateThumbnailUrl(record);
}
return Alfresco.constants.URL_RESCONTEXT + 'components/images/filetypes/' + Alfresco.util.getFileIcon(record.displayName);
};
try
{
result = callback.apply(this, args);
Alfresco.DocumentList.generateThumbnailUrl = generateThumbnailUrl;
}
catch (e)
{
Alfresco.DocumentList.generateThumbnailUrl = generateThumbnailUrl;
throw e;
}
return result;
};
// adapt the document list fnRenderCellThumbnail to remove preview when no preview can be generated (node without content) and use
// information available for file icon determination
Alfresco.DocumentList.prototype._nbc_fnRenderCellThumbnail = Alfresco.DocumentList.prototype.fnRenderCellThumbnail;
Alfresco.DocumentList.prototype.fnRenderCellThumbnail = function(renderChain)
{
var scope = this, realRenderer = this._nbc_fnRenderCellThumbnail(), renderCallback = renderChain;
return function(elCell, oRecord, oColumn, oData)
{
var id, node = oRecord.getData().jsNode;
NABUCCO.component.CMISDocumentList.withFileIconOverride.call(this, function()
{
NABUCCO.component.CMISDocumentList.withThumbnailOverride.call(this, function()
{
if (YAHOO.lang.isFunction(renderCallback))
{
renderCallback.call(this, realRenderer, arguments);
}
else
{
realRenderer.apply(this, arguments);
}
}, arguments);
}, [ elCell, oRecord, oColumn, oData ]);
// OOTB view renderer always prepare preview even if node has no content
if (!(node.isContainer || (node.isLink && node.linkedNode.isContainer))
&& !(YAHOO.lang.isString(node.contentURL) || (node.isLink && YAHOO.lang.isString(node.linkedNode.contentURL))))
{
// check for any thumbnails that are not supported due to node without content
id = scope.id + '-preview-' + oRecord.getId();
if (Alfresco.util.arrayContains(scope.previewTooltips, id))
{
scope.previewTooltips = Alfresco.util.arrayRemove(scope.previewTooltips, id);
}
}
};
};
// adapt size renderer for items without content as well as links
Alfresco.DocumentList.prototype._nbc_setupMetadataRenderers = Alfresco.DocumentList.prototype._setupMetadataRenderers;
Alfresco.DocumentList.prototype._setupMetadataRenderers = function()
{
this._nbc_setupMetadataRenderers();
/**
* File size
*/
this.registerRenderer("size", function(record, label)
{
var jsNode = record.jsNode, html = "";
if ((YAHOO.lang.isString(jsNode.contentURL) || YAHOO.lang.isNumber(jsNode.size)) || (jsNode.isLink && (YAHOO.lang.isString(jsNode.linkedNode.contentURL) || YAHOO.lang.isNumber(jsNode.linkedNode.size))))
{
html += '<span class="item">' + label
+ Alfresco.util.formatFileSize(YAHOO.lang.isString(jsNode.contentURL) || YAHOO.lang.isNumber(jsNode.size) ? jsNode.size : jsNode.linkedNode.size)
+ '</span>';
}
return html;
});
};
(function()
{
// additional properties for jsNode
var additionalJsNodeProps = [ "isContent" ];
// adapt Node to support our additional properties
Alfresco.util._nbc_Node = Alfresco.util.Node;
Alfresco.util.Node = function(p_node)
{
var jsNode = Alfresco.util._nbc_Node(p_node), idx, propName;
if (YAHOO.lang.isObject(jsNode))
{
for (idx = 0; idx < additionalJsNodeProps.length; idx++)
{
propName = additionalJsNodeProps[idx];
// override only if no such property has been defined yet
if (p_node.hasOwnProperty(propName) && !jsNode.hasOwnProperty(propName))
{
if (propName.indexOf("Node") !== -1 && propName.substr(propName.indexOf("Node")) === "Node"
&& YAHOO.lang.isString(p_node[propName]))
{
jsNode[propName] = new Alfresco.util.NodeRef(p_node[propName]);
}
else
{
jsNode[propName] = p_node[propName];
}
}
}
}
return jsNode;
};
}());
Alfresco.util.getFileIcon.types["D:cmiscustom:document"] = "file";
Alfresco.util.getFileIcon.types["cmis:document"] = "file";
Alfresco.util.getFileIcon.types["cmis:folder"] = "folder";
}()); | AFaust/alfresco-cmis-documentlist | share/src/main/webapp/nabucco/components/cmis-documentlibrary/documentlist.js | JavaScript | epl-1.0 | 11,911 | 36.459119 | 214 | 0.56494 | false |
/*******************************************************************************
* Copyright (c) 2017 TypeFox GmbH (http://www.typefox.io) 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
*******************************************************************************/
package org.eclipse.xtext.formatting2.regionaccess.internal;
import static org.eclipse.xtext.formatting2.regionaccess.HiddenRegionPartAssociation.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.formatting2.debug.TextRegionAccessToString;
import org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion;
import org.eclipse.xtext.formatting2.regionaccess.IHiddenRegion;
import org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion;
import org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess;
import org.eclipse.xtext.formatting2.regionaccess.ITextRegionDiffBuilder;
import org.eclipse.xtext.formatting2.regionaccess.ITextSegment;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.ISequenceAcceptor;
import org.eclipse.xtext.util.ITextRegion;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
/**
* @author Moritz Eysholdt - Initial contribution and API
*/
public class StringBasedTextRegionAccessDiffBuilder implements ITextRegionDiffBuilder {
private final static Logger LOG = Logger.getLogger(StringBasedTextRegionAccessDiffBuilder.class);
protected interface Insert {
public IHiddenRegion getInsertFirst();
public IHiddenRegion getInsertLast();
}
protected static class MoveSource extends Rewrite {
private MoveTarget target = null;
public MoveSource(IHiddenRegion first, IHiddenRegion last) {
super(first, last);
}
public MoveTarget getTarget() {
return target;
}
}
protected static class MoveTarget extends Rewrite implements Insert {
private final MoveSource source;
public MoveTarget(IHiddenRegion insertAt, MoveSource source) {
super(insertAt, insertAt);
this.source = source;
this.source.target = this;
}
@Override
public IHiddenRegion getInsertFirst() {
return this.source.originalFirst;
}
@Override
public IHiddenRegion getInsertLast() {
return this.source.originalLast;
}
}
protected static class Remove extends Rewrite {
public Remove(IHiddenRegion originalFirst, IHiddenRegion originalLast) {
super(originalFirst, originalLast);
}
}
protected static class Replace1 extends Rewrite implements Insert {
private final IHiddenRegion modifiedFirst;
private final IHiddenRegion modifiedLast;
public Replace1(IHiddenRegion originalFirst, IHiddenRegion originalLast, IHiddenRegion modifiedFirst,
IHiddenRegion modifiedLast) {
super(originalFirst, originalLast);
this.modifiedFirst = modifiedFirst;
this.modifiedLast = modifiedLast;
}
@Override
public IHiddenRegion getInsertFirst() {
return this.modifiedFirst;
}
@Override
public IHiddenRegion getInsertLast() {
return this.modifiedLast;
}
}
protected static class Preserve extends Rewrite implements Insert {
public Preserve(IHiddenRegion first, IHiddenRegion last) {
super(first, last);
}
@Override
public IHiddenRegion getInsertFirst() {
return this.originalFirst;
}
@Override
public IHiddenRegion getInsertLast() {
return this.originalLast;
}
@Override
public boolean isDiff() {
return false;
}
}
public abstract static class Rewrite implements Comparable<Rewrite> {
protected IHiddenRegion originalFirst;
protected IHiddenRegion originalLast;
public Rewrite(IHiddenRegion originalFirst, IHiddenRegion originalLast) {
super();
this.originalFirst = originalFirst;
this.originalLast = originalLast;
}
public boolean isDiff() {
return true;
}
@Override
public int compareTo(Rewrite o) {
return Integer.compare(originalFirst.getOffset(), o.originalFirst.getOffset());
}
}
protected static class Replace2 extends Rewrite implements Insert {
private final TextRegionAccessBuildingSequencer sequencer;
public Replace2(IHiddenRegion originalFirst, IHiddenRegion originalLast,
TextRegionAccessBuildingSequencer sequencer) {
super(originalFirst, originalLast);
this.sequencer = sequencer;
}
@Override
public IHiddenRegion getInsertFirst() {
return sequencer.getRegionAccess().regionForRootEObject().getPreviousHiddenRegion();
}
@Override
public IHiddenRegion getInsertLast() {
return sequencer.getRegionAccess().regionForRootEObject().getNextHiddenRegion();
}
}
private final ITextRegionAccess original;
private List<Rewrite> rewrites = Lists.newArrayList();
private Map<ITextSegment, String> changes = Maps.newHashMap();
public StringBasedTextRegionAccessDiffBuilder(ITextRegionAccess base) {
super();
this.original = base;
}
protected void checkOriginal(ITextSegment segment) {
Preconditions.checkNotNull(segment);
Preconditions.checkArgument(original == segment.getTextRegionAccess());
}
protected List<Rewrite> createList() {
List<Rewrite> sorted = Lists.newArrayList(rewrites);
Collections.sort(sorted);
List<Rewrite> result = Lists.newArrayListWithExpectedSize(sorted.size() * 2);
IHiddenRegion last = original.regionForRootEObject().getPreviousHiddenRegion();
for (Rewrite rw : sorted) {
int lastOffset = last.getOffset();
int rwOffset = rw.originalFirst.getOffset();
if (rwOffset == lastOffset) {
result.add(rw);
last = rw.originalLast;
} else if (rwOffset > lastOffset) {
result.add(new Preserve(last, rw.originalFirst));
result.add(rw);
last = rw.originalLast;
} else {
LOG.error("Error, conflicting document modifications.");
}
}
IHiddenRegion end = original.regionForRootEObject().getNextHiddenRegion();
if (last.getOffset() < end.getOffset()) {
result.add(new Preserve(last, end));
}
return result;
}
@Override
public StringBasedTextRegionAccessDiff create() {
StringBasedTextRegionAccessDiffAppender appender = createAppender();
IEObjectRegion root = original.regionForRootEObject();
appender.copyAndAppend(root.getPreviousHiddenRegion(), PREVIOUS);
appender.copyAndAppend(root.getPreviousHiddenRegion(), CONTAINER);
List<Rewrite> rws = createList();
IHiddenRegion last = null;
for (Rewrite rw : rws) {
boolean diff = rw.isDiff();
if (diff) {
appender.beginDiff();
}
if (rw instanceof Insert) {
Insert ins = (Insert) rw;
IHiddenRegion f = ins.getInsertFirst();
IHiddenRegion l = ins.getInsertLast();
appender.copyAndAppend(f, NEXT);
if (f != l) {
appender.copyAndAppend(f.getNextSemanticRegion(), l.getPreviousSemanticRegion());
}
appender.copyAndAppend(l, PREVIOUS);
}
if (diff) {
appender.endDiff();
}
if (rw.originalLast != last) {
appender.copyAndAppend(rw.originalLast, CONTAINER);
}
last = rw.originalLast;
}
appender.copyAndAppend(root.getNextHiddenRegion(), NEXT);
StringBasedTextRegionAccessDiff result = appender.finish();
AbstractEObjectRegion newRoot = result.regionForEObject(root.getSemanticElement());
result.setRootEObject(newRoot);
return result;
}
protected StringBasedTextRegionAccessDiffAppender createAppender() {
return new StringBasedTextRegionAccessDiffAppender(original, changes);
}
@Override
public ITextRegionAccess getOriginalTextRegionAccess() {
return original;
}
@Override
public boolean isModified(ITextRegion region) {
int offset = region.getOffset();
int endOffset = offset + region.getLength();
for (Rewrite action : rewrites) {
int rwOffset = action.originalFirst.getOffset();
int rwEndOffset = action.originalLast.getEndOffset();
if (rwOffset <= offset && offset < rwEndOffset) {
return true;
}
if (rwOffset < endOffset && endOffset <= rwEndOffset) {
return true;
}
}
return false;
}
@Override
public void move(IHiddenRegion insertAt, IHiddenRegion substituteFirst, IHiddenRegion substituteLast) {
checkOriginal(insertAt);
checkOriginal(substituteFirst);
checkOriginal(substituteLast);
MoveSource source = new MoveSource(substituteFirst, substituteLast);
MoveTarget target = new MoveTarget(insertAt, source);
rewrites.add(source);
rewrites.add(target);
}
@Override
public void remove(IHiddenRegion first, IHiddenRegion last) {
checkOriginal(first);
checkOriginal(last);
rewrites.add(new Remove(first, last));
}
@Override
public void remove(ISemanticRegion region) {
remove(region.getPreviousHiddenRegion(), region.getNextHiddenRegion());
}
@Override
public void replace(IHiddenRegion originalFirst, IHiddenRegion originalLast, IHiddenRegion modifiedFirst,
IHiddenRegion modifiedLast) {
checkOriginal(originalFirst);
checkOriginal(originalLast);
rewrites.add(new Replace1(originalFirst, originalLast, modifiedFirst, modifiedLast));
}
@Override
public void replace(IHiddenRegion originalFirst, IHiddenRegion originalLast, ITextRegionAccess acc) {
checkOriginal(originalFirst);
checkOriginal(originalLast);
IEObjectRegion substituteRoot = acc.regionForRootEObject();
IHiddenRegion substituteFirst = substituteRoot.getPreviousHiddenRegion();
IHiddenRegion substituteLast = substituteRoot.getNextHiddenRegion();
replace(originalFirst, originalLast, substituteFirst, substituteLast);
}
@Override
public void replace(ISemanticRegion region, String newText) {
Preconditions.checkNotNull(newText);
checkOriginal(region);
changes.put(region, newText);
}
@Override
public ISequenceAcceptor replaceSequence(IHiddenRegion originalFirst, IHiddenRegion originalLast,
ISerializationContext ctx, EObject root) {
checkOriginal(originalFirst);
checkOriginal(originalLast);
TextRegionAccessBuildingSequencer sequenceAcceptor = new TextRegionAccessBuildingSequencer();
rewrites.add(new Replace2(originalFirst, originalLast, sequenceAcceptor));
return sequenceAcceptor.withRoot(ctx, root);
}
@Override
public String toString() {
try {
StringBasedTextRegionAccessDiff regions = create();
return new TextRegionAccessToString().withRegionAccess(regions).toString();
} catch (Throwable t) {
return t.getMessage() + "\n" + Throwables.getStackTraceAsString(t);
}
}
} | miklossy/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/formatting2/regionaccess/internal/StringBasedTextRegionAccessDiffBuilder.java | Java | epl-1.0 | 10,636 | 29.742775 | 106 | 0.754889 | false |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_21) on Wed Nov 12 14:55:37 EST 2014 -->
<TITLE>
org.eclipse.mylyn.wikitext.markdown.core
</TITLE>
<META NAME="date" CONTENT="2014-11-12">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../../../../org/eclipse/mylyn/wikitext/markdown/core/package-summary.html" target="classFrame">org.eclipse.mylyn.wikitext.markdown.core</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="MarkdownLanguage.html" title="class in org.eclipse.mylyn.wikitext.markdown.core" target="classFrame">MarkdownLanguage</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| elelpublic/wikitext-all | apidoc/org/eclipse/mylyn/wikitext/markdown/core/package-frame.html | HTML | epl-1.0 | 974 | 29.4375 | 161 | 0.675565 | false |
/**
*/
package org.eclipse.papyrus.RobotML.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.RobotML.RobotMLPackage;
import org.eclipse.papyrus.RobotML.RoboticMiddleware;
import org.eclipse.papyrus.RobotML.RoboticMiddlewareKind;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Robotic Middleware</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.RobotML.impl.RoboticMiddlewareImpl#getKind <em>Kind</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RoboticMiddlewareImpl extends PlatformImpl implements RoboticMiddleware {
/**
* The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKind()
* @generated
* @ordered
*/
protected static final RoboticMiddlewareKind KIND_EDEFAULT = RoboticMiddlewareKind.RT_MAPS;
/**
* The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKind()
* @generated
* @ordered
*/
protected RoboticMiddlewareKind kind = KIND_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RoboticMiddlewareImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RobotMLPackage.Literals.ROBOTIC_MIDDLEWARE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RoboticMiddlewareKind getKind() {
return kind;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKind(RoboticMiddlewareKind newKind) {
RoboticMiddlewareKind oldKind = kind;
kind = newKind == null ? KIND_EDEFAULT : newKind;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RobotMLPackage.ROBOTIC_MIDDLEWARE__KIND, oldKind, kind));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RobotMLPackage.ROBOTIC_MIDDLEWARE__KIND:
return getKind();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RobotMLPackage.ROBOTIC_MIDDLEWARE__KIND:
setKind((RoboticMiddlewareKind)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RobotMLPackage.ROBOTIC_MIDDLEWARE__KIND:
setKind(KIND_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RobotMLPackage.ROBOTIC_MIDDLEWARE__KIND:
return kind != KIND_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (kind: ");
result.append(kind);
result.append(')');
return result.toString();
}
} //RoboticMiddlewareImpl
| RobotML/RobotML-SDK-Juno | plugins/robotml/org.eclipse.papyrus.robotml/src/org/eclipse/papyrus/RobotML/impl/RoboticMiddlewareImpl.java | Java | epl-1.0 | 3,660 | 21.875 | 114 | 0.643989 | false |
/*******************************************************************************
* Copyright (c) 2000, 2016 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
*
* Based on org.eclipse.jdt.internal.ui.text.javadoc.JavaDocAutoIndentStrategy
*
* Contributors:
* IBM Corporation - initial API and implementation
* Red Hat, Inc - decoupling from jdt.ui
*******************************************************************************/
package org.eclipse.jdt.ls.core.internal.contentassist;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.manipulation.CodeGeneration;
import org.eclipse.jdt.internal.core.manipulation.StubUtility;
import org.eclipse.jdt.internal.corext.util.MethodOverrideTester;
import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache;
import org.eclipse.jdt.ls.core.internal.JDTUtils;
import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin;
import org.eclipse.jdt.ls.core.internal.handlers.CompletionResolveHandler;
import org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.lsp4j.CompletionItem;
import org.eclipse.lsp4j.CompletionItemKind;
import org.eclipse.lsp4j.InsertTextFormat;
import org.eclipse.lsp4j.Range;
import org.eclipse.lsp4j.TextEdit;
public class JavadocCompletionProposal {
private static final String ASTERISK = "*";
private static final String WHITESPACES = " \t";
public static final String JAVA_DOC_COMMENT = "Javadoc comment";
public List<CompletionItem> getProposals(ICompilationUnit cu, int offset, CompletionProposalRequestor collector, IProgressMonitor monitor) throws JavaModelException {
if (cu == null) {
throw new IllegalArgumentException("Compilation unit must not be null"); //$NON-NLS-1$
}
List<CompletionItem> result = new ArrayList<>();
IDocument d = JsonRpcHelpers.toDocument(cu.getBuffer());
if (offset < 0 || d.getLength() == 0) {
return result;
}
try {
int p = (offset == d.getLength() ? offset - 1 : offset);
IRegion line = d.getLineInformationOfOffset(p);
String lineStr = d.get(line.getOffset(), line.getLength()).trim();
if (!lineStr.startsWith("/**")) {
return result;
}
if (!hasEndJavadoc(d, offset)) {
return result;
}
String text = collector.getContext().getToken() == null ? "" : new String(collector.getContext().getToken());
StringBuilder buf = new StringBuilder(text);
IRegion prefix = findPrefixRange(d, line);
String indentation = d.get(prefix.getOffset(), prefix.getLength());
int lengthToAdd = Math.min(offset - prefix.getOffset(), prefix.getLength());
buf.append(indentation.substring(0, lengthToAdd));
String lineDelimiter = TextUtilities.getDefaultLineDelimiter(d);
ICompilationUnit unit = cu;
try {
unit.reconcile(ICompilationUnit.NO_AST, false, null, null);
String string = createJavaDocTags(d, offset, indentation, lineDelimiter, unit);
if (string != null && !string.trim().equals(ASTERISK)) {
buf.append(string);
} else {
return result;
}
int nextNonWS = findEndOfWhiteSpace(d, offset, d.getLength());
if (!Character.isWhitespace(d.getChar(nextNonWS))) {
buf.append(lineDelimiter);
}
} catch (CoreException e) {
// ignore
}
final CompletionItem ci = new CompletionItem();
Range range = JDTUtils.toRange(unit, offset, 0);
boolean isSnippetSupported = JavaLanguageServerPlugin.getPreferencesManager().getClientPreferences().isCompletionSnippetsSupported();
String replacement = prepareTemplate(buf.toString(), lineDelimiter, isSnippetSupported);
ci.setTextEdit(new TextEdit(range, replacement));
ci.setFilterText(JAVA_DOC_COMMENT);
ci.setLabel(JAVA_DOC_COMMENT);
ci.setSortText(SortTextHelper.convertRelevance(0));
ci.setKind(CompletionItemKind.Snippet);
ci.setInsertTextFormat(isSnippetSupported ? InsertTextFormat.Snippet : InsertTextFormat.PlainText);
String documentation = prepareTemplate(buf.toString(), lineDelimiter, false);
if (documentation.indexOf(lineDelimiter) == 0) {
documentation = documentation.replaceFirst(lineDelimiter, "");
}
ci.setDocumentation(documentation);
Map<String, String> data = new HashMap<>(3);
data.put(CompletionResolveHandler.DATA_FIELD_URI, JDTUtils.toURI(cu));
data.put(CompletionResolveHandler.DATA_FIELD_REQUEST_ID, "0");
data.put(CompletionResolveHandler.DATA_FIELD_PROPOSAL_ID, "0");
ci.setData(data);
result.add(ci);
} catch (BadLocationException excp) {
// stop work
}
return result;
}
private String prepareTemplate(String text, String lineDelimiter, boolean addGap) {
boolean endWithLineDelimiter = text.endsWith(lineDelimiter);
String[] lines = text.split(lineDelimiter);
StringBuilder buf = new StringBuilder();
for (int i = 0; i < lines.length; i++) {
String line = lines[i];
if (addGap) {
String stripped = StringUtils.stripStart(line, WHITESPACES);
if (stripped.startsWith(ASTERISK)) {
if (!stripped.equals(ASTERISK)) {
int index = line.indexOf(ASTERISK);
buf.append(line.substring(0, index + 1));
buf.append(" ${0}");
buf.append(lineDelimiter);
}
addGap = false;
}
}
buf.append(StringUtils.stripEnd(line, WHITESPACES));
if (i < lines.length - 1 || endWithLineDelimiter) {
buf.append(lineDelimiter);
}
}
return buf.toString();
}
private IRegion findPrefixRange(IDocument document, IRegion line) throws BadLocationException {
int lineOffset = line.getOffset();
int lineEnd = lineOffset + line.getLength();
int indentEnd = findEndOfWhiteSpace(document, lineOffset, lineEnd);
if (indentEnd < lineEnd && document.getChar(indentEnd) == '*') {
indentEnd++;
while (indentEnd < lineEnd && document.getChar(indentEnd) == ' ') {
indentEnd++;
}
}
return new Region(lineOffset, indentEnd - lineOffset);
}
private int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
while (offset < end) {
char c = document.getChar(offset);
if (c != ' ' && c != '\t') {
return offset;
}
offset++;
}
return end;
}
private boolean hasEndJavadoc(IDocument document, int offset) throws BadLocationException {
int pos = -1;
while (offset < document.getLength()) {
char c = document.getChar(offset);
if (!Character.isWhitespace(c) && !(c == '*')) {
pos = offset;
break;
}
offset++;
}
if (document.getLength() >= pos + 2 && document.get(pos - 1, 2).equals("*/")) {
return true;
}
return false;
}
private String createJavaDocTags(IDocument document, int offset, String indentation, String lineDelimiter, ICompilationUnit unit) throws CoreException, BadLocationException {
IJavaElement element = unit.getElementAt(offset);
if (element == null) {
return null;
}
switch (element.getElementType()) {
case IJavaElement.TYPE:
return createTypeTags(document, offset, indentation, lineDelimiter, (IType) element);
case IJavaElement.METHOD:
return createMethodTags(document, offset, indentation, lineDelimiter, (IMethod) element);
default:
return null;
}
}
private String createTypeTags(IDocument document, int offset, String indentation, String lineDelimiter, IType type) throws CoreException, BadLocationException {
if (!accept(offset, type)) {
return null;
}
String[] typeParamNames = StubUtility.getTypeParameterNames(type.getTypeParameters());
String comment = CodeGeneration.getTypeComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), typeParamNames, lineDelimiter);
if (comment != null) {
return prepareTemplateComment(comment.trim(), indentation, type.getJavaProject(), lineDelimiter);
}
return null;
}
private boolean accept(int offset, IMember member) throws JavaModelException {
ISourceRange nameRange = member.getNameRange();
if (nameRange == null) {
return false;
}
int srcOffset = nameRange.getOffset();
return srcOffset > offset;
}
private String createMethodTags(IDocument document, int offset, String indentation, String lineDelimiter, IMethod method) throws CoreException, BadLocationException {
if (!accept(offset, method)) {
return null;
}
IMethod inheritedMethod = getInheritedMethod(method);
String comment = CodeGeneration.getMethodComment(method, inheritedMethod, lineDelimiter);
if (comment != null) {
comment = comment.trim();
boolean javadocComment = comment.startsWith("/**"); //$NON-NLS-1$
if (javadocComment) {
return prepareTemplateComment(comment, indentation, method.getJavaProject(), lineDelimiter);
}
}
return null;
}
private String prepareTemplateComment(String comment, String indentation, IJavaProject project, String lineDelimiter) {
// trim comment start and end if any
if (comment.endsWith("*/")) {
comment = comment.substring(0, comment.length() - 2);
}
comment = comment.trim();
if (comment.startsWith("/*")) { //$NON-NLS-1$
if (comment.length() > 2 && comment.charAt(2) == '*') {
comment = comment.substring(3); // remove '/**'
} else {
comment = comment.substring(2); // remove '/*'
}
}
// trim leading spaces, but not new lines
int nonSpace = 0;
int len = comment.length();
while (nonSpace < len && Character.getType(comment.charAt(nonSpace)) == Character.SPACE_SEPARATOR) {
nonSpace++;
}
comment = comment.substring(nonSpace);
return comment;
}
private IMethod getInheritedMethod(IMethod method) throws JavaModelException {
IType declaringType = method.getDeclaringType();
MethodOverrideTester tester = SuperTypeHierarchyCache.getMethodOverrideTester(declaringType);
return tester.findOverriddenMethod(method, true);
}
}
| gorkem/java-language-server | org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/JavadocCompletionProposal.java | Java | epl-1.0 | 10,626 | 37.64 | 175 | 0.718332 | false |
package mx.com.cinepolis.digital.booking.commons.exception;
/**
* Clase con los códigos de errores para las excepciones
* @author rgarcia
*
*/
public enum DigitalBookingExceptionCode
{
/** Error desconocido */
GENERIC_UNKNOWN_ERROR(0),
/***
* CATALOG NULO
*/
CATALOG_ISNULL(1),
/**
* Paging Request Nulo
*/
PAGING_REQUEST_ISNULL(2),
/**
* Errores de persistencia
*/
PERSISTENCE_ERROR_GENERIC(3),
PERSISTENCE_ERROR_NEW_OBJECT_FOUND_DURING_COMMIT(4),
PERSISTENCE_ERROR_CATALOG_ALREADY_REGISTERED(5),
PERSISTENCE_ERROR_CATALOG_NOT_FOUND(6),
PERSISTENCE_ERROR_CATALOG_ALREADY_REGISTERED_WITH_ID_VISTA(7),
PERSISTENCE_ERROR_WEEK_ALREADY_REGISTERED(8),
/**
* Errores de Administración de Catalogos
*/
THEATER_NUM_THEATER_ALREADY_EXISTS(9),
CANNOT_DELETE_REGION(10),
INEXISTENT_REGION(11),
INVALID_TERRITORY(12),
THEATER_IS_NULL(13),
THEATER_IS_NOT_IN_ANY_REGION(14),
THEATER_NOT_HAVE_SCREENS(15),
INEXISTENT_THEATER(16),
THEATER_IS_NOT_IN_ANY_CITY(17),
THEATER_IS_NOT_IN_ANY_STATE(18),
INVALID_SCREEN(19),
INVALID_MOVIE_FORMATS(20),
INVALID_SOUND_FORMATS(21),
FILE_NULL(22),
EVENT_MOVIE_NULL(23),
/**
* Errores de Administración de cines
*/
SCREEN_NUMBER_ALREADY_EXISTS(24),
SCREEN_NEEDS_AT_LEAST_ONE_SOUND_FORMAT(25),
SCREEN_NEEDS_AT_LEAST_ONE_MOVIE_FORMAT(26),
DISTRIBUTOR_IS_ASSOCIATED_WITH_AN_EXISTING_MOVIE(27),
CATEGORY_SOUND_FORMAT_IS_ASSOCIATED_WITH_AN_EXISTING_MOVIE(28),
CATEGORY_SOUND_FORMAT_IS_ASSOCIATED_WITH_AN_EXISTING_SCREEN(29),
CATEGORY_MOVIE_FORMAT_IS_ASSOCIATED_WITH_AN_EXISTING_MOVIE(30),
CATEGORY_MOVIE_FORMAT_IS_ASSOCIATED_WITH_AN_EXISTING_SCREEN(31),
CATEGORY_SCREEN_FORMAT_IS_ASSOCIATED_WITH_AN_EXISTING_SCREEN(39),
SCREEN_NEEDS_SCREEN_FORMAT(32),
MOVIE_NAME_BLANK(33),
MOVIE_DISTRIBUTOR_NULL(35),
MOVIE_COUNTRIES_EMPTY(36),
MOVIE_DETAIL_EMPTY(37),
MOVIE_IMAGE_NULL(38),
/**
* Booking errors
*/
BOOKING_PERSISTENCE_ERROR_STATUS_NOT_FOUND(40),
BOOKING_PERSISTENCE_ERROR_EVENT_NOT_FOUND(41),
BOOKING_PERSISTENCE_ERROR_THEATER_NOT_FOUND(42),
BOOKING_PERSISTENCE_ERROR_WEEK_NOT_FOUND(43),
BOOKING_PERSISTENCE_ERROR_BOOKING_NOT_FOUND(44),
BOOKING_PERSISTENCE_ERROR_USER_NOT_FOUND(45),
BOOKING_PERSISTENCE_ERROR_EVENT_TYPE_NOT_FOUND(46),
BOOKING_PERSISTENCE_ERROR_AT_CONSULT_BOOKINGS(221),
/**
* Week errors
*/
WEEK_PERSISTENCE_ERROR_NOT_FOUND(50),
/**
* Observation errors
*/
NEWS_FEED_OBSERVATION_NOT_FOUND(51),
BOOKING_OBSERVATION_NOT_FOUND2(52),
OBSERVATION_NOT_FOUND(53),
NEWS_FEED_OBSERVATION_ASSOCIATED_TO_ANOTHER_USER(103),
/**
* Email Errors
*/
EMAIL_DOES_NOT_COMPLIES_REGEX(54),
EMAIL_IS_REPEATED(55),
/**
* Configuration Errors
*/
CONFIGURATION_ID_IS_NULL(60),
CONFIGURATION_NAME_IS_NULL(61),
CONFIGURATION_PARAMETER_NOT_FOUND(62),
/**
* Email Errors
*/
ERROR_SENDING_EMAIL_NO_DATA(70),
ERROR_SENDING_EMAIL_NO_RECIPIENTS(71),
ERROR_SENDING_EMAIL_SUBJECT(72),
ERROR_SENDING_EMAIL_MESSAGE(73),
/**
* Booking errors
*/
BOOKING_IS_NULL(74),
BOOKING_COPIES_IS_NULL(75),
BOOKING_WEEK_NULL(76),
BOOKING_EVENT_NULL(77),
BOOKING_WRONG_STATUS_FOR_CANCELLATION(78),
BOOKING_WRONG_STATUS_FOR_TERMINATION(79),
BOOKING_THEATER_NEEDS_WEEK_ID(80),
BOOKING_THEATER_NEEDS_THEATER_ID(81),
BOOKING_NUMBER_COPIES_ZERO(82),
BOOKING_NUM_SCREENS_GREATER_NUM_COPIES(83),
BOOKING_CAN_NOT_BE_CANCELED(84),
BOOKING_CAN_NOT_BE_TERMINATED(85),
BOOKING_WRONG_STATUS_FOR_EDITION(86),
ERROR_THEATER_HAS_NO_EMAIL(87),
BOOKING_NUMBER_OF_COPIES_EXCEEDS_NUMBER_OF_SCREENS(88),
BOOKING_NON_EDITABLE_WEEK(89),
BOOKING_THEATER_REPEATED(90),
BOOKING_IS_WEEK_ONE(91),
BOOKING_THEATER_HAS_SCREEN_ZERO(92),
BOOKING_MAXIMUM_COPY(93),
BOOKING_NOT_SAVED_FOR_CANCELLATION(94),
BOOKING_NOT_SAVED_FOR_TERMINATION(194),
BOOKING_NOT_THEATERS_IN_REGION(196),
BOOKING_NUMBER_OF_COPIES_EXCEEDS_NUMBER_OF_SCREENS_WHIT_THIS_FORMAT(195),
BOOKING_NUM_SCREENS_GREATER_NUM_COPIES_NO_THEATER(95),
BOOKING_SENT_CAN_NOT_BE_CANCELED(96),
BOOKING_SENT_CAN_NOT_BE_TERMINATED(97),
BOOKING_WITH_FOLLOWING_WEEK_CAN_NOT_BE_CANCELED(98),
BOOKING_WITH_FOLLOWING_WEEK_CAN_NOT_BE_TERMINATED(99),
/**
* Report errors
*/
CREATE_XLSX_ERROR(100),
BOOKING_THEATER_IS_NOT_ASSIGNED_TO_ANY_SCREEN(101),
SEND_EMAIL_REGION_ERROR_CAN_ONLY_UPLOAD_UP_TO_TWO_FILES(102),
/**
* Security errors
*/
SECURITY_ERROR_USER_DOES_NOT_EXISTS(200),
SECURITY_ERROR_PASSWORD_INVALID(201),
SECURITY_ERROR_INVALID_USER(202),
MENU_EXCEPTION(203),
/**
* UserErrors
*/
USER_IS_NULL(204),
USER_USERNAME_IS_BLANK(205),
USER_NAME_IS_BLANK(206),
USER_LAST_NAME_IS_BLANK(207),
USER_ROLE_IS_NULL(208),
USER_EMAIL_IS_NULL(209),
USER_THE_USERNAME_IS_DUPLICATE(210),
USER_TRY_DELETE_OWN_USER(211),
/**
* Week errors
*/
WEEK_IS_NULL(212),
WEEK_INVALID_NUMBER(213),
WEEK_INVALID_YEAR(214),
WEEK_INVALID_FINAL_DAY(215),
/**
* EventMovie errors
*/
EVENT_CODE_DBS_NULL(216),
CATALOG_ALREADY_REGISTERED_WITH_DS_CODE_DBS(217),
CATALOG_ALREADY_REGISTERED_WITH_SHORT_NAME(218),
CANNOT_DELETE_WEEK(219),
CANNOT_REMOVE_EVENT_MOVIE(220),
/**
* Income errors
*/
INCOMES_COULD_NOT_OBTAIN_DATABASE_PROPERTIES(300),
INCOMES_DRIVER_ERROR(301),
INCOMES_CONNECTION_ERROR(302),
/**
* SynchronizeErrors
*/
CANNOT_CONNECT_TO_SERVICE(500),
/**
* Transaction timeout
*/
TRANSACTION_TIMEOUT(501),
/**
* INVALID PARAMETERS FOR BOOKING PRE RELEASE
*/
INVALID_COPIES_PARAMETER(600),
INVALID_DATES_PARAMETERS(601),
INVALID_SCREEN_PARAMETER_CASE_ONE(602),
INVALID_SCREEN_PARAMETER_CASE_TWO(603),
INVALID_DATES_BEFORE_TODAY_PARAMETERS(604),
INVALID_PRESALE_DATES_PARAMETERS(605),
/**
* VALIDATIONS FOR PRESALE IN BOOKING MOVIE
*/
ERROR_BOOKING_PRESALE_FOR_NO_PREMIERE(606),
ERROR_BOOKING_PRESALE_FOR_ZERO_SCREEN(607),
ERROR_BOOKING_PRESALE_NOT_ASSOCIATED_AT_BOOKING(608),
/**
* INVALID SELECTION OF PARAMETERS
* TO APPLY IN SPECIAL EVENT
*/
INVALID_STARTING_DATES(617),
INVALID_FINAL_DATES(618),
INVALID_STARTING_AND_RELREASE_DATES(619),
INVALID_THEATER_SELECTION(620),
INVALID_SCREEN_SELECTION(621),
BOOKING_THEATER_NULL(622),
BOOKING_TYPE_INVALID(623),
BOOKING_SPECIAL_EVENT_LIST_EMPTY(624),
/**
* Invalid datetime range for system log.
*/
LOG_FINAL_DATE_BEFORE_START_DATE(625),
LOG_INVALID_DATE_RANGE(626),
LOG_INVALID_TIME_RANGE(627),
/**
* Invavlid cityTO
*/
CITY_IS_NULL(628),
CITY_HAS_NO_NAME(629),
CITY_HAS_NO_COUNTRY(630),
CITY_INVALID_LIQUIDATION_ID(631),
PERSISTENCE_ERROR_CATALOG_ALREADY_REGISTERED_WITH_LIQUIDATION_ID(632)
;
/**
* Constructor interno
*
* @param id
*/
private DigitalBookingExceptionCode( int id )
{
this.id = id;
}
private int id;
/**
* @return the id
*/
public int getId()
{
return id;
}
}
| sidlors/digital-booking | digital-booking-commons/src/main/java/mx/com/cinepolis/digital/booking/commons/exception/DigitalBookingExceptionCode.java | Java | epl-1.0 | 7,193 | 24.496454 | 76 | 0.676773 | false |
package com.temenos.soa.plugin.uml2dsconverter.utils;
// General String utilities
public class StringUtils {
/**
* Turns the first character of a string in to an uppercase character
* @param source The source string
* @return String Resultant string
*/
public static String upperInitialCharacter(String source) {
final StringBuilder result = new StringBuilder(source.length());
result.append(Character.toUpperCase(source.charAt(0))).append(source.substring(1));
return result.toString();
}
/**
* Turns the first character of a string in to a lowercase character
* @param source The source string
* @return String Resultant string
*/
public static String lowerInitialCharacter(String source) {
final StringBuilder result = new StringBuilder(source.length());
result.append(Character.toLowerCase(source.charAt(0))).append(source.substring(1));
return result.toString();
}
}
| junejosheeraz/UML2DS | com.temenos.soa.plugin.uml2dsconverter/src/com/temenos/soa/plugin/uml2dsconverter/utils/StringUtils.java | Java | epl-1.0 | 938 | 33.740741 | 88 | 0.730277 | false |
# -*- coding: utf-8 -*-
#
# Phaser Editor documentation build configuration file, created by
# sphinx-quickstart on Thu May 25 08:35:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
#'rinoh.frontend.sphinx'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Phaser Editor 2D'
copyright = u'2016-2020, Arian Fornaris'
author = u'Arian Fornaris'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'2.1.7'
# The full version, including alpha/beta/rc tags.
release = u'2.1.7'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#import sphinx_rtd_theme
html_theme = "phaser-editor"
# Uncomment for generate Eclipse Offline Help
#html_theme = "eclipse-help"
html_theme_path = ["_themes"]
html_show_sourcelink = False
html_show_sphinx = False
html_favicon = "logo.png"
html_title = "Phaser Editor Help"
html_show_copyright = True
print(html_theme_path)
#html_theme = 'classic'
highlight_language = 'javascript'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'PhaserEditordoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
'preamble': '',
# Latex figure (float) alignment
#
'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'PhaserEditor2D.tex', u'Phaser Editor 2D Documentation',
u'Arian Fornaris', 'manual'),
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'PhaserEditor2D', u'Phaser Editor 2D Documentation',
author, 'Arian', 'A friendly HTML5 game IDE.',
'Miscellaneous'),
]
| boniatillo-com/PhaserEditor | docs/v2/conf.py | Python | epl-1.0 | 4,869 | 27.810651 | 79 | 0.685562 | false |
/******************************************************************************
* Copyright (c) 2000-2015 Ericsson Telecom AB
* 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
******************************************************************************/
package org.eclipse.titan.designer.AST.TTCN3.values.expressions;
import java.util.List;
import org.eclipse.titan.designer.AST.ASTVisitor;
import org.eclipse.titan.designer.AST.INamedNode;
import org.eclipse.titan.designer.AST.IReferenceChain;
import org.eclipse.titan.designer.AST.IValue;
import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.AST.Value;
import org.eclipse.titan.designer.AST.IType.Type_type;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
import org.eclipse.titan.designer.AST.TTCN3.values.Expression_Value;
import org.eclipse.titan.designer.AST.TTCN3.values.Hexstring_Value;
import org.eclipse.titan.designer.AST.TTCN3.values.Octetstring_Value;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException;
import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;
/**
* @author Kristof Szabados
* */
public final class Hex2OctExpression extends Expression_Value {
private static final String OPERANDERROR = "The operand of the `hex2oct' operation should be a hexstring value";
private final Value value;
public Hex2OctExpression(final Value value) {
this.value = value;
if (value != null) {
value.setFullNameParent(this);
}
}
@Override
public Operation_type getOperationType() {
return Operation_type.HEX2OCT_OPERATION;
}
@Override
public String createStringRepresentation() {
final StringBuilder builder = new StringBuilder();
builder.append("hex2oct(").append(value.createStringRepresentation()).append(')');
return builder.toString();
}
@Override
public void setMyScope(final Scope scope) {
super.setMyScope(scope);
if (value != null) {
value.setMyScope(scope);
}
}
@Override
public StringBuilder getFullName(final INamedNode child) {
final StringBuilder builder = super.getFullName(child);
if (value == child) {
return builder.append(OPERAND);
}
return builder;
}
@Override
public Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) {
return Type_type.TYPE_OCTETSTRING;
}
@Override
public boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue,
final IReferenceChain referenceChain) {
if (value == null) {
return true;
}
return value.isUnfoldable(timestamp, expectedValue, referenceChain);
}
/**
* Checks the parameters of the expression and if they are valid in
* their position in the expression or not.
*
* @param timestamp
* the timestamp of the actual semantic check cycle.
* @param expectedValue
* the kind of value expected.
* @param referenceChain
* a reference chain to detect cyclic references.
* */
private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue,
final IReferenceChain referenceChain) {
if (value == null) {
return;
}
value.setLoweridToReference(timestamp);
Type_type tempType = value.getExpressionReturntype(timestamp, expectedValue);
switch (tempType) {
case TYPE_HEXSTRING:
value.getValueRefdLast(timestamp, expectedValue, referenceChain);
return;
case TYPE_UNDEFINED:
setIsErroneous(true);
return;
default:
if (!isErroneous) {
location.reportSemanticError(OPERANDERROR);
setIsErroneous(true);
}
return;
}
}
@Override
public IValue evaluateValue(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue,
final IReferenceChain referenceChain) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return lastValue;
}
isErroneous = false;
lastTimeChecked = timestamp;
lastValue = this;
if (value == null) {
return lastValue;
}
checkExpressionOperands(timestamp, expectedValue, referenceChain);
if (getIsErroneous(timestamp)) {
return lastValue;
}
if (isUnfoldable(timestamp, referenceChain)) {
return lastValue;
}
IValue last = value.getValueRefdLast(timestamp, referenceChain);
if (last.getIsErroneous(timestamp)) {
setIsErroneous(true);
return lastValue;
}
switch (last.getValuetype()) {
case HEXSTRING_VALUE:
String temp = ((Hexstring_Value) last).getValue();
lastValue = new Octetstring_Value(hex2oct(temp));
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
public static String hex2oct(final String hexString) {
if (hexString.length() % 2 == 0) {
return hexString;
}
return new StringBuilder(hexString.length() + 1).append('0').append(hexString).toString();
}
@Override
public void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
if (referenceChain.add(this) && value != null) {
referenceChain.markState();
value.checkRecursions(timestamp, referenceChain);
referenceChain.previousState();
}
}
@Override
public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
if (isDamaged) {
throw new ReParseException();
}
if (value != null) {
value.updateSyntax(reparser, false);
reparser.updateLocation(value.getLocation());
}
}
@Override
public void findReferences(final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) {
if (value == null) {
return;
}
value.findReferences(referenceFinder, foundIdentifiers);
}
@Override
protected boolean memberAccept(final ASTVisitor v) {
if (value != null && !value.accept(v)) {
return false;
}
return true;
}
}
| alovassy/titan.EclipsePlug-ins | org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/Hex2OctExpression.java | Java | epl-1.0 | 6,252 | 27.81106 | 122 | 0.726328 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Selecting and Using a Font" />
<meta name="DC.Relation" scheme="URI" content="GUID-98B85D7F-7BD9-5056-A99F-0BC99D921B87.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-72986B3C-047C-5411-8F15-BC9C65C3289C.html" />
<meta name="DC.Relation" scheme="URI" content="index.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-32E29020-1956-461A-B79A-1492E06049E7.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-1DCA2F4D-ABE6-52A0-AC4E-5AAC1AB5909D.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-762A665F-43D0-53ED-B698-0CBD3AC46391.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-98B85D7F-7BD9-5056-A99F-0BC99D921B87.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-C1B080D9-9C6C-520B-B73E-4EB344B1FC5E.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-90644B52-69D7-595C-95E3-D6F7A30C060D.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-71DADA82-3ABC-52D2-8360-33FAEB2E5DE9.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-416A3756-B5D5-5BCD-830E-2371C5F6B502.html" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47" />
<meta name="DC.Language" content="en" />
<link rel="stylesheet" type="text/css" href="commonltr.css" />
<title>
Selecting and Using a Font
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="nokiacxxref.css" />
</head>
<body id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2470542 id2400118 id2400126 id2400140 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
<a href="GUID-32E29020-1956-461A-B79A-1492E06049E7.html" title="The Symbian Guide describes the architecture and functionality of the platform, and provides guides on using its APIs.">
Symbian Guide
</a>
>
<a href="GUID-1DCA2F4D-ABE6-52A0-AC4E-5AAC1AB5909D.html">
Text and Localization Guide
</a>
>
<a href="GUID-762A665F-43D0-53ED-B698-0CBD3AC46391.html" title="The Font and Text Services Collection contains the Font Store and related plug-ins and the Text Rendering component. Application developers can select fonts from the Font Store. Device creators can create and add fonts.">
Font and Text Services Collection
</a>
>
<a href="GUID-98B85D7F-7BD9-5056-A99F-0BC99D921B87.html" title="You can use the Font and Text Services to select a font or typeface for your text.">
Font and Text Services Tutorials
</a>
>
</div>
<h1 class="topictitle1">
Selecting and Using a Font
</h1>
<div>
<p>
To select a font you must create a specification that defines the characteristics of the font that you require. The fonts available are specific to the current graphics device (normally the screen device). The graphics device uses the Font and Bitmap server to access the Font Store. The Font Store finds the best match from the fonts installed.
</p>
<p>
The current font is part of the current graphics context. Once the font system has selected a font to match your specification you must update the current context to use the new font.
</p>
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-C4671145-FEDE-5A82-8085-7E5802545DE9">
<!-- -->
</a>
<ol id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-C4671145-FEDE-5A82-8085-7E5802545DE9">
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-66508D29-FC01-5B64-A043-759503EC04FF">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-66508D29-FC01-5B64-A043-759503EC04FF">
<!-- -->
</a>
<p>
Set up a font specification (
<samp class="codeph">
TFontSpec
</samp>
).
</p>
</li>
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-E6F70C38-003C-5AFF-B73D-67244058FFCF">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-E6F70C38-003C-5AFF-B73D-67244058FFCF">
<!-- -->
</a>
<p>
Create a
<samp class="codeph">
CFont
</samp>
pointer. The font itself will be allocated by FBServ on the shared heap. This pointer will not be used to allocate or free any memory.
</p>
</li>
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-93C743E0-2689-5AA3-8F24-937C38D7A7BB">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-93C743E0-2689-5AA3-8F24-937C38D7A7BB">
<!-- -->
</a>
<p>
Use the font spec and the font pointer to obtain a font from the Font Store. This must be done through the screen device.
</p>
</li>
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-9DB15BD2-8014-59AC-94CA-30161E3DB553">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-9DB15BD2-8014-59AC-94CA-30161E3DB553">
<!-- -->
</a>
<p>
Set the graphic context's current font to the
<samp class="codeph">
CFont
</samp>
obtained from the Font Store.
</p>
</li>
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-2F9586D4-5C1C-5ADC-A816-4AE7C29CA44A">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-2F9586D4-5C1C-5ADC-A816-4AE7C29CA44A">
<!-- -->
</a>
<p>
Use the font.
</p>
</li>
<li id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-DAB05CE0-1710-5B79-A921-41BFDEF8B1FD">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-DAB05CE0-1710-5B79-A921-41BFDEF8B1FD">
<!-- -->
</a>
<p>
Tidy up by discarding the font from the graphics context and releasing it from the graphics device.
</p>
</li>
</ol>
<pre class="codeblock" id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-D37CB9EF-CED1-59EB-95AE-D50E020D2FF8">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-D37CB9EF-CED1-59EB-95AE-D50E020D2FF8">
<!-- -->
</a>
// Create a font specification
_LIT( KMyFontName,"Swiss") ;
const TInt KMyFontHeightInTwips = 240 ; // 12 point
TFontSpec myFontSpec( KMyFontName, KMyFontHeightInTwips ) ;
// Create a font pointer (the font itself is on the FBServ shared heap)
CFont* myFont ;
// Fonts are graphics device specific. In this case the graphics device is the screen
CGraphicsDevice* screenDevice = iCoeEnv->ScreenDevice() ;
// Get the font that most closely matches the font spec.
screenDevice->GetNearestFontToMaxHeightInTwips( myFont , myFontSpec ) ;
// Pass the font to the current graphics context
CWindowGc& gc = SystemGc() ;
gc.UseFont( myFont ) ;
// Use the gc to draw text. Use the most appropriate CGraphicsContext::DrawText() function.
TPoint textPos( 0, myFont->AscentInPixels() ) ; // left hand end of baseline.
_LIT( KMyText, "Some text to write" ) ;
gc.DrawText( KMyText, textPos ) ; // Uses current pen etc.
// Tidy up. Discard and release the font
gc.DiscardFont() ;
screenDevice->ReleaseFont( myFont ) ;
</pre>
<p>
There are a number of
<samp class="codeph">
DrawText()
</samp>
function in
<a href="GUID-DAD09DCF-3123-38B4-99E9-91FB24B92138.html">
<span class="apiname">
CGraphicsContext
</span>
</a>
that you can use for positioning text at a specified position or within a rectangle. The pen and brush are those in the current context.
</p>
<p>
You can query the metrics of the font using
<a href="GUID-2A12FE3B-47F2-3016-8161-A971CA506491.html">
<span class="apiname">
CFont
</span>
</a>
to ensure that your text is correctly located. You can also establish the size of individual characters and text strings.
</p>
<p>
<strong>
Note:
</strong>
<a href="GUID-2A12FE3B-47F2-3016-8161-A971CA506491.html">
<span class="apiname">
CFont
</span>
</a>
is an abstract base class. You can use it to query a font supplied by the font system but you cannot instantiate it.
</p>
<pre class="codeblock" id="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-996A661A-581B-50A4-B844-91DE4514F1EA">
<a name="GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47__GUID-996A661A-581B-50A4-B844-91DE4514F1EA">
<!-- -->
</a>
class CFont // CFont is an abstract class.
{
public:
TUid TypeUid() const;
TInt HeightInPixels() const;
TInt AscentInPixels() const;
TInt DescentInPixels() const;
TInt CharWidthInPixels(TChar aChar) const;
TInt TextWidthInPixels(const TDesC& aText) const;
TInt BaselineOffsetInPixels() const;
TInt TextCount(const TDesC& aText,TInt aWidthInPixels) const;
TInt TextCount(const TDesC& aText,TInt aWidthInPixels,
TInt& aExcessWidthInPixels) const;
TInt MaxCharWidthInPixels() const;
TInt MaxNormalCharWidthInPixels() const;
TFontSpec FontSpecInTwips() const;
TCharacterDataAvailability GetCharacterData(TUint aCode,
TOpenFontCharMetrics& aMetrics,
const TUint8*& aBitmap,
TSize& aBitmapSize) const;
TBool GetCharacterPosition(TPositionParam& aParam) const;
TInt WidthZeroInPixels() const;
TInt MeasureText(const TDesC& aText,
const TMeasureTextInput* aInput = NULL,
TMeasureTextOutput* aOutput = NULL) const;
static TBool CharactersJoin(TInt aLeftCharacter, TInt aRightCharacter);
TInt ExtendedFunction(TUid aFunctionId, TAny* aParam = NULL) const;
TBool GetCharacterPosition2(TPositionParam& aParam, RShapeInfo& aShapeInfo) const;
TInt TextWidthInPixels(const TDesC& aText,const TMeasureTextInput* aParam) const;
....
</pre>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink">
<strong>
<a href="GUID-72986B3C-047C-5411-8F15-BC9C65C3289C.html">
Using Typefaces
</a>
</strong>
<br />
</li>
</ul>
<div class="familylinks">
<div class="parentlink">
<strong>
Parent topic:
</strong>
<a href="GUID-98B85D7F-7BD9-5056-A99F-0BC99D921B87.html" title="You can use the Font and Text Services to select a font or typeface for your text.">
Font and Text Services Tutorials
</a>
</div>
</div>
<div class="relinfo relconcepts">
<strong>
Related concepts
</strong>
<br />
<div>
<a href="GUID-C1B080D9-9C6C-520B-B73E-4EB344B1FC5E.html" title="The Graphics Device Interface (GDI) collection is an important collection within the Graphics subsystem. It provides a suite of abstract base classes, interfaces and data structures. The suite represents and interacts with physical graphics hardware such as display screens, off-screen memory and printers.">
GDI Collection Overview
</a>
</div>
<div>
<a href="GUID-90644B52-69D7-595C-95E3-D6F7A30C060D.html" title="A font is a set of characters of matching size (height) and appearance. In order to be displayed each character must ultimately be drawn as a series of pixels (a bitmap). Symbian can store fonts in bitmap or vector form. A vector font (for example, an OpenType font) must be converted to bitmaps (or rasterized) before it can be drawn. Symbian caches and shares bitmaps for performance and memory efficiency.">
Font and Text Services Collection
Overview
</a>
</div>
<div>
<a href="GUID-71DADA82-3ABC-52D2-8360-33FAEB2E5DE9.html" title="The Font and Bitmap Server (FBServ) provides a memory efficient way of using bitmaps and fonts. It stores a single instance of each bitmap in either a shared heap or in eXecute In Place (XIP) ROM and provides clients with read and (when appropriate) write access.">
Font and Bitmap Server Component Overview
</a>
</div>
<div>
<a href="GUID-416A3756-B5D5-5BCD-830E-2371C5F6B502.html" title="The Font Store contains all of the fonts and typefaces on a phone. It is encapsulated by the Font and Bitmap server which provides a client-side class that applications use to find which fonts are available and to find fonts to match their requirements.">
Font Store Component Overview
</a>
</div>
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-78FB26E2-AA60-5531-B2FE-4FA6C88F2D47.html | HTML | epl-1.0 | 14,484 | 44.265625 | 481 | 0.665769 | false |
requirejs(['bmotion.config'], function() {
requirejs(['bms.integrated.root'], function() {});
});
| ladenberger/bmotion-frontend | app/js/bmotion.integrated.js | JavaScript | epl-1.0 | 100 | 32.333333 | 52 | 0.64 | false |
/*
* Copyright (c) 2013 Red Hat, Inc. and/or its affiliates.
*
* 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:
* Brad Davis - bradsdavis@gmail.com - Initial API and implementation
*/
package org.jboss.windup.interrogator.impl;
import java.io.File;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.windup.metadata.decoration.Summary;
import org.jboss.windup.metadata.decoration.AbstractDecoration.NotificationLevel;
import org.jboss.windup.metadata.type.FileMetadata;
import org.jboss.windup.metadata.type.XmlMetadata;
import org.jboss.windup.metadata.type.ZipEntryMetadata;
import org.w3c.dom.Document;
/**
* Interrogates XML files. Extracts the XML, and creates an XmlMetadata object, which is passed down
* the decorator pipeline.
*
* @author bdavis
*
*/
public class XmlInterrogator extends ExtensionInterrogator<XmlMetadata> {
private static final Log LOG = LogFactory.getLog(XmlInterrogator.class);
@Override
public void processMeta(XmlMetadata fileMeta) {
Document document = fileMeta.getParsedDocument();
if (document == null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Document was null. Problem parsing: " + fileMeta.getFilePointer().getAbsolutePath());
}
// attach the bad file so we see it in the reports...
fileMeta.getArchiveMeta().getEntries().add(fileMeta);
return;
}
super.processMeta(fileMeta);
}
@Override
public boolean isOfInterest(XmlMetadata fileMeta) {
return true;
}
@Override
public XmlMetadata archiveEntryToMeta(ZipEntryMetadata archiveEntry) {
File file = archiveEntry.getFilePointer();
LOG.debug("Processing XML: " + file.getAbsolutePath());
FileMetadata meta = null;
if (file.length() > 1048576L * 1) {
LOG.warn("XML larger than 1 MB: " + file.getAbsolutePath() + "; Skipping processing.");
meta = new FileMetadata();
meta.setArchiveMeta(archiveEntry.getArchiveMeta());
meta.setFilePointer(file);
Summary sr = new Summary();
sr.setDescription("File is too large; skipped.");
sr.setLevel(NotificationLevel.WARNING);
meta.getDecorations().add(sr);
}
else {
XmlMetadata xmlMeta = new XmlMetadata();
xmlMeta.setArchiveMeta(archiveEntry.getArchiveMeta());
xmlMeta.setFilePointer(file);
meta = xmlMeta;
return xmlMeta;
}
return null;
}
@Override
public XmlMetadata fileEntryToMeta(FileMetadata entry) {
File file = entry.getFilePointer();
LOG.debug("Processing XML: " + file.getAbsolutePath());
FileMetadata meta = null;
if (file.length() > 1048576L * 1) {
LOG.warn("XML larger than 1 MB: " + file.getAbsolutePath() + "; Skipping processing.");
meta = new FileMetadata();
//meta.setArchiveMeta(archiveEntry.getArchiveMeta());
meta.setFilePointer(file);
meta.setArchiveMeta(entry.getArchiveMeta());
Summary sr = new Summary();
sr.setDescription("File is too large; skipped.");
sr.setLevel(NotificationLevel.WARNING);
meta.getDecorations().add(sr);
}
else {
XmlMetadata xmlMeta = new XmlMetadata();
xmlMeta.setArchiveMeta(entry.getArchiveMeta());
xmlMeta.setFilePointer(file);
meta = xmlMeta;
return xmlMeta;
}
return null;
}
}
| Maarc/windup-as-a-service | windup_0_7/windup-engine/src/main/java/org/jboss/windup/interrogator/impl/XmlInterrogator.java | Java | epl-1.0 | 3,422 | 28.5 | 101 | 0.726184 | false |
package de.uks.beast.editor.util;
public enum Fonts
{
//@formatter:off
HADOOP_MASTER_TITEL ("Arial", 10, true, true),
HADOOP_SLAVE_TITEL ("Arial", 10, true, true),
NETWORK_TITEL ("Arial", 10, true, true),
CONTROL_CENTER_TITEL ("Arial", 10, true, true),
HADOOP_MASTER_PROPERTY ("Arial", 8, false, true),
HADOOP_SLAVE_PROPERTY ("Arial", 8, false, true),
NETWORK_PROPERTY ("Arial", 8, false, true),
CONTROL_CENTER_PROPERTY ("Arial", 8, false, true),
;//@formatter:on
private final String name;
private final int size;
private final boolean italic;
private final boolean bold;
private Fonts(final String name, final int size, final boolean italic, final boolean bold)
{
this.name = name;
this.size = size;
this.italic = italic;
this.bold = bold;
}
/**
* @return the name
*/
public String getName()
{
return name;
}
/**
* @return the size
*/
public int getSize()
{
return size;
}
/**
* @return the italic
*/
public boolean isItalic()
{
return italic;
}
/**
* @return the bold
*/
public boolean isBold()
{
return bold;
}
}
| fujaba/BeAST | de.uks.beast.editor/src/de/uks/beast/editor/util/Fonts.java | Java | epl-1.0 | 1,163 | 15.152778 | 91 | 0.60877 | false |
var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);
};
function exit(code) {
setTimeout(function(){ phantom.exit(code); }, 0);
phantom.onError = function(){};
}
console.log("Loading URL: " + url);
page.open(url, function (status) {
if (status != "success") {
console.log('Failed to open ' + url);
phantom.exit(1);
}
console.log("Running test.");
var result = page.evaluate(function() {
return chess_game.test_runner.runner();
});
if (result != 0) {
console.log("*** Test failed! ***");
exit(1);
}
else {
console.log("Test succeeded.");
exit(0);
}
});
| tmtwd/chess-om | env/test/js/unit-test.js | JavaScript | epl-1.0 | 765 | 17.214286 | 51 | 0.597386 | false |
#include "genfft.h"
/**
* NAME: cc1fft
*
* DESCRIPTION: complex to complex FFT
*
* USAGE:
* void cc1fft(complex *data, int n, int sign)
*
* INPUT: - *data: complex 1D input vector
* - n: number of samples in input vector data
* - sign: sign of the Fourier kernel
*
* OUTPUT: - *data: complex 1D output vector unscaled
*
* NOTES: Optimized system dependent FFT's implemented for:
* - inplace FFT from Mayer and SU (see file fft_mayer.c)
*
* AUTHOR:
* Jan Thorbecke (janth@xs4all.nl)
* The Netherlands
*
*
*----------------------------------------------------------------------
* REVISION HISTORY:
* VERSION AUTHOR DATE COMMENT
* 1.0 Jan Thorbecke Feb '94 Initial version (TU Delft)
* 1.1 Jan Thorbecke June '94 faster in-place FFT
* 2.0 Jan Thorbecke July '97 added Cray SGI calls
* 2.1 Alexander Koek June '98 updated SCS for use inside
* parallel loops
*
*
----------------------------------------------------------------------*/
#if defined(ACML440)
#if defined(DOUBLE)
#define acmlcc1fft zfft1dx
#else
#define acmlcc1fft cfft1dx
#endif
#endif
void cc1fft(complex *data, int n, int sign)
{
#if defined(HAVE_LIBSCS)
int ntable, nwork, zero=0;
static int isys, nprev[MAX_NUMTHREADS];
static float *work[MAX_NUMTHREADS], *table[MAX_NUMTHREADS], scale=1.0;
int pe, i;
#elif defined(ACML440)
static int nprev=0;
int nwork, zero=0, one=1, inpl=1, i;
static int isys;
static complex *work;
REAL scl;
complex *y;
#endif
#if defined(HAVE_LIBSCS)
pe = mp_my_threadnum();
assert ( pe <= MAX_NUMTHREADS );
if (n != nprev[pe]) {
isys = 0;
ntable = 2*n + 30;
nwork = 2*n;
/* allocate memory on each processor locally for speed */
if (work[pe]) free(work[pe]);
work[pe] = (float *)malloc(nwork*sizeof(float));
if (work[pe] == NULL)
fprintf(stderr,"cc1fft: memory allocation error\n");
if (table[pe]) free(table[pe]);
table[pe] = (float *)malloc(ntable*sizeof(float));
if (table[pe] == NULL)
fprintf(stderr,"cc1fft: memory allocation error\n");
ccfft_(&zero, &n, &scale, data, data, table[pe], work[pe], &isys);
nprev[pe] = n;
}
ccfft_(&sign, &n, &scale, data, data, table[pe], work[pe], &isys);
#elif defined(ACML440)
scl = 1.0;
if (n != nprev) {
isys = 0;
nwork = 5*n + 100;
if (work) free(work);
work = (complex *)malloc(nwork*sizeof(complex));
if (work == NULL) fprintf(stderr,"rc1fft: memory allocation error\n");
acmlcc1fft(zero, scl, inpl, n, data, 1, y, 1, work, &isys);
nprev = n;
}
acmlcc1fft(sign, scl, inpl, n, data, 1, y, 1, work, &isys);
#else
cc1_fft(data, n, sign);
#endif
return;
}
/****************** NO COMPLEX DEFINED ******************/
void Rcc1fft(float *data, int n, int sign)
{
cc1fft((complex *)data, n , sign);
return;
}
/****************** FORTRAN SHELL *****************/
void cc1fft_(complex *data, int *n, int *sign)
{
cc1fft(data, *n, *sign);
return;
}
| sun031/Jan | FFTlib/cc1fft.c | C | epl-1.0 | 3,110 | 26.043478 | 72 | 0.56045 | false |
#include "SimpleGameLogic.h"
#include "GameWorld.h"
#include "MonstersPlace.h"
void SimpleGameLogic::worldLoaded()
{
_physicsWorld = _world->getGameContent()->getPhysicsWorld();
_physicsWorld->setCollisionCallback(this);
_tank = static_cast<Tank*>(_world->getGameContent()->getObjectByName("Player"));
ControllerManager::getInstance()->registerListener(this);
std::vector<MonstersPlace*> monstersPlaces = _world->getGameContent()->getObjectsByTypeName<MonstersPlace>(GameObjectType::MONSTERS_PLACE);
for (auto monstersPlace : monstersPlaces)
{
MonstersPlaceHandler *handler = new MonstersPlaceHandler(_world, monstersPlace, _tank);
_handlers.push_back(handler);
}
}
void SimpleGameLogic::update(float delta)
{
_physicsWorld->update(delta);
for (auto handler : _handlers)
{
handler->update(delta);
}
}
void SimpleGameLogic::onKeyDown(EventKeyboard::KeyCode keyCode)
{
if (keyCode == EventKeyboard::KeyCode::KEY_LEFT_ARROW)
{
_tank->moveLeft();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_RIGHT_ARROW)
{
_tank->moveRight();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_UP_ARROW)
{
_tank->moveForward();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_DOWN_ARROW)
{
_tank->moveBackward();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_X)
{
_tank->fire();
}
}
void SimpleGameLogic::onKeyPress(EventKeyboard::KeyCode keyCode)
{
if (keyCode == EventKeyboard::KeyCode::KEY_Q)
{
_tank->prevWeapon();
} else if (keyCode == EventKeyboard::KeyCode::KEY_W)
{
_tank->nextWeapon();
}
}
void SimpleGameLogic::onKeyUp(EventKeyboard::KeyCode keyCode)
{
if (keyCode == EventKeyboard::KeyCode::KEY_LEFT_ARROW)
{
_tank->stopMoveLeft();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_RIGHT_ARROW)
{
_tank->stopMoveRight();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_UP_ARROW)
{
_tank->stopMoveBackward();
}
else if (keyCode == EventKeyboard::KeyCode::KEY_DOWN_ARROW)
{
_tank->stopMoveBackward();
}
}
void SimpleGameLogic::onPointsBeginContact(SimplePhysicsPoint* pointA, SimplePhysicsPoint* pointB)
{
BaseGameObject *gameObjectA = static_cast<BaseGameObject*>(pointA->getUserData());
BaseGameObject *gameObjectB = static_cast<BaseGameObject*>(pointB->getUserData());
//ToDo êàê-òî íàäî îáîéòè ýòó ïðîâåðêó
if (gameObjectA->getType() == GameObjectType::TANK && gameObjectB->getType() == GameObjectType::TANK_BULLET
|| gameObjectB->getType() == GameObjectType::TANK && gameObjectA->getType() == GameObjectType::TANK_BULLET)
{
return;
}
if (isMonster(gameObjectA) && isMonster(gameObjectB))
{
return;
}
DamageableObject *damageableObjectA = dynamic_cast<DamageableObject*>(gameObjectA);
DamageObject *damageObjectB = dynamic_cast<DamageObject*>(gameObjectB);
if (damageableObjectA && damageObjectB)
{
DamageInfo *damageInfo = damageObjectB->getDamageInfo();
damageableObjectA->damage(damageInfo);
damageObjectB->onAfterDamage(damageableObjectA);
delete damageInfo;
}
DamageableObject *damageableObjectB = dynamic_cast<DamageableObject*>(gameObjectB);
DamageObject *damageObjectA = dynamic_cast<DamageObject*>(gameObjectA);
if (damageableObjectB && damageObjectA)
{
DamageInfo *damageInfo = damageObjectA->getDamageInfo();
damageableObjectB->damage(damageInfo);
damageObjectA->onAfterDamage(damageableObjectB);
delete damageInfo;
}
}
void SimpleGameLogic::onPointReachedBorder(SimplePhysicsPoint* point)
{
BaseGameObject *gameObject = static_cast<BaseGameObject*>(point->getUserData());
if (gameObject)
{
if (gameObject->getType() == GameObjectType::TANK_BULLET)
{
scheduleOnce([=](float dt){
gameObject->detachFromWorld();
delete gameObject;
}, 0.0f, "DestroyGameObject");
}
}
}
bool SimpleGameLogic::isMonster(BaseGameObject *gameObject)
{
return gameObject->getType() == GameObjectType::MONSTER1
|| gameObject->getType() == GameObjectType::MONSTER2
|| gameObject->getType() == GameObjectType::MONSTER3;
}
| cjsbox-xx/tanchiks | Classes/SimpleGameLogic.cpp | C++ | epl-1.0 | 3,968 | 26.555556 | 140 | 0.731855 | false |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Thu Jun 12 19:19:11 EDT 2014 -->
<title>Uses of Class com.runescape.revised.content.skill.combat.prayer.standard.UnstoppableForce</title>
<meta name="date" content="2014-06-12">
<link rel="stylesheet" type="text/css" href="../../../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.runescape.revised.content.skill.combat.prayer.standard.UnstoppableForce";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../../com/runescape/revised/content/skill/combat/prayer/standard/UnstoppableForce.html" title="class in com.runescape.revised.content.skill.combat.prayer.standard">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../../index.html?com/runescape/revised/content/skill/combat/prayer/standard/class-use/UnstoppableForce.html" target="_top">Frames</a></li>
<li><a href="UnstoppableForce.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.runescape.revised.content.skill.combat.prayer.standard.UnstoppableForce" class="title">Uses of Class<br>com.runescape.revised.content.skill.combat.prayer.standard.UnstoppableForce</h2>
</div>
<div class="classUseContainer">No usage of com.runescape.revised.content.skill.combat.prayer.standard.UnstoppableForce</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../../com/runescape/revised/content/skill/combat/prayer/standard/UnstoppableForce.html" title="class in com.runescape.revised.content.skill.combat.prayer.standard">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../../index.html?com/runescape/revised/content/skill/combat/prayer/standard/class-use/UnstoppableForce.html" target="_top">Frames</a></li>
<li><a href="UnstoppableForce.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| RodriguesJ/Atem | doc/com/runescape/revised/content/skill/combat/prayer/standard/class-use/UnstoppableForce.html | HTML | epl-1.0 | 4,750 | 40.304348 | 213 | 0.614316 | false |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.client.solrj.request;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.response.SolrPingResponse;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
/**
* Verify that there is a working Solr core at the URL of a {@link org.apache.solr.client.solrj.SolrClient}.
* To use this class, the solrconfig.xml for the relevant core must include the
* request handler for <code>/admin/ping</code>.
*
* @since solr 1.3
*/
public class SolrPing extends SolrRequest<SolrPingResponse> {
/** serialVersionUID. */
private static final long serialVersionUID = 5828246236669090017L;
/** Request parameters. */
private ModifiableSolrParams params;
/**
* Create a new SolrPing object.
*/
public SolrPing() {
super(METHOD.GET, CommonParams.PING_HANDLER);
params = new ModifiableSolrParams();
}
@Override
protected SolrPingResponse createResponse(SolrClient client) {
return new SolrPingResponse();
}
@Override
public ModifiableSolrParams getParams() {
return params;
}
/**
* Remove the action parameter from this request. This will result in the same
* behavior as {@code SolrPing#setActionPing()}. For Solr server version 4.0
* and later.
*
* @return this
*/
public SolrPing removeAction() {
params.remove(CommonParams.ACTION);
return this;
}
/**
* Set the action parameter on this request to enable. This will delete the
* health-check file for the Solr core. For Solr server version 4.0 and later.
*
* @return this
*/
public SolrPing setActionDisable() {
params.set(CommonParams.ACTION, CommonParams.DISABLE);
return this;
}
/**
* Set the action parameter on this request to enable. This will create the
* health-check file for the Solr core. For Solr server version 4.0 and later.
*
* @return this
*/
public SolrPing setActionEnable() {
params.set(CommonParams.ACTION, CommonParams.ENABLE);
return this;
}
/**
* Set the action parameter on this request to ping. This is the same as not
* including the action at all. For Solr server version 4.0 and later.
*
* @return this
*/
public SolrPing setActionPing() {
params.set(CommonParams.ACTION, CommonParams.PING);
return this;
}
}
| DavidGutknecht/elexis-3-base | bundles/org.apache.solr/src/org/apache/solr/client/solrj/request/SolrPing.java | Java | epl-1.0 | 3,236 | 30.72549 | 108 | 0.716007 | false |
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2020.05.20 um 02:10:33 PM CEST
//
package ch.fd.invoice450.request;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Java-Klasse für xtraDrugType complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* <complexType name="xtraDrugType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="indicated" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="iocm_category">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="A"/>
* <enumeration value="B"/>
* <enumeration value="C"/>
* <enumeration value="D"/>
* <enumeration value="E"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="delivery" default="first">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="first"/>
* <enumeration value="repeated"/>
* <enumeration value="permanent"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="regulation_attributes" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="0" />
* <attribute name="limitation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "xtraDrugType")
public class XtraDrugType {
@XmlAttribute(name = "indicated")
protected Boolean indicated;
@XmlAttribute(name = "iocm_category")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String iocmCategory;
@XmlAttribute(name = "delivery")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String delivery;
@XmlAttribute(name = "regulation_attributes")
@XmlSchemaType(name = "unsignedInt")
protected Long regulationAttributes;
@XmlAttribute(name = "limitation")
protected Boolean limitation;
/**
* Ruft den Wert der indicated-Eigenschaft ab.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isIndicated() {
return indicated;
}
/**
* Legt den Wert der indicated-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIndicated(Boolean value) {
this.indicated = value;
}
/**
* Ruft den Wert der iocmCategory-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIocmCategory() {
return iocmCategory;
}
/**
* Legt den Wert der iocmCategory-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIocmCategory(String value) {
this.iocmCategory = value;
}
/**
* Ruft den Wert der delivery-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDelivery() {
if (delivery == null) {
return "first";
} else {
return delivery;
}
}
/**
* Legt den Wert der delivery-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDelivery(String value) {
this.delivery = value;
}
/**
* Ruft den Wert der regulationAttributes-Eigenschaft ab.
*
* @return
* possible object is
* {@link Long }
*
*/
public long getRegulationAttributes() {
if (regulationAttributes == null) {
return 0L;
} else {
return regulationAttributes;
}
}
/**
* Legt den Wert der regulationAttributes-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setRegulationAttributes(Long value) {
this.regulationAttributes = value;
}
/**
* Ruft den Wert der limitation-Eigenschaft ab.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLimitation() {
return limitation;
}
/**
* Legt den Wert der limitation-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLimitation(Boolean value) {
this.limitation = value;
}
}
| DavidGutknecht/elexis-3-base | bundles/at.medevit.elexis.tarmed.model/src-gen/ch/fd/invoice450/request/XtraDrugType.java | Java | epl-1.0 | 5,592 | 26.268293 | 127 | 0.584258 | false |
/*******************************************************************************
* Copyright (c) 2001, 2005 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
* Jens Lukowski/Innoopract - initial renaming/restructuring
*
*******************************************************************************/
package org.eclipse.wst.xml.core.internal.contenttype;
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
/**
* This class can be used in place of an EncodingMemento (its super class),
* when there is not in fact ANY encoding information. For example, when a
* structuredDocument is created directly from a String
*/
public class NullMemento extends EncodingMemento {
/**
*
*/
public NullMemento() {
super();
String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
setJavaCharsetName(defaultCharset);
setAppropriateDefault(defaultCharset);
setDetectedCharsetName(null);
}
}
| ttimbul/eclipse.wst | bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java | Java | epl-1.0 | 1,336 | 35.108108 | 81 | 0.672904 | false |
/*******************************************************************************
* Copyright (c) 2013-2015 UAH Space Research Group.
* 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:
* MICOBS SRG Team - Initial API and implementation
******************************************************************************/
package es.uah.aut.srg.micobs.mclev.library.mclevlibrary;
/**
* A representation of an MCLEV Library versioned item corresponding to the
* model of a regular component.
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link es.uah.aut.srg.micobs.mclev.library.mclevlibrary.MMCLEVVersionedItemComponent#getSwPackageURI <em>Sw Package URI</em>}</li>
* <li>{@link es.uah.aut.srg.micobs.mclev.library.mclevlibrary.MMCLEVVersionedItemComponent#getSwPackageVersion <em>Sw Package Version</em>}</li>
* </ul>
* </p>
*
* @see es.uah.aut.srg.micobs.mclev.library.mclevlibrary.mclevlibraryPackage#getMMCLEVVersionedItemComponent()
* @model
* @generated
*/
public interface MMCLEVVersionedItemComponent extends MMCLEVPackageVersionedItem {
/**
* Returns the URI of the MESP software package that stores the
* implementation of the component or <code>null</code> if no software
* package is defined for the component.
* @return the URI of the attached MESP software package or
* <code>null</code> if no software package is defined for the component.
* @see #setSwPackageURI(String)
* @see es.uah.aut.srg.micobs.mclev.library.mclevlibrary.mclevlibraryPackage#getMMCLEVVersionedItemComponent_SwPackageURI()
* @model
* @generated
*/
String getSwPackageURI();
/**
* Sets the URI of the MESP software package that stores the
* implementation of the component.
* @param value the new URI of the attached MESP software package.
* @see #getSwPackageURI()
* @generated
*/
void setSwPackageURI(String value);
/**
* Returns the version of the MESP software package that stores the
* implementation of the component or <code>null</code> if no software
* package is defined for the component.
* @return the version of the attached MESP software package or
* <code>null</code> if no software package is defined for the component.
* @see #setSwPackageVersion(String)
* @see es.uah.aut.srg.micobs.mclev.library.mclevlibrary.mclevlibraryPackage#getMMCLEVVersionedItemComponent_SwPackageVersion()
* @model
* @generated
*/
String getSwPackageVersion();
/**
* Sets the version of the MESP software package that stores the
* implementation of the component.
* @param value the new version of the attached MESP software package.
* @see #getSwPackageVersion()
* @generated
*/
void setSwPackageVersion(String value);
/**
* Returns the value of the '<em><b>Sw Interface URI</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Sw Interface URI</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Sw Interface URI</em>' attribute.
* @see #setSwInterfaceURI(String)
* @see es.uah.aut.srg.micobs.mclev.library.mclevlibrary.mclevlibraryPackage#getMMCLEVVersionedItemComponent_SwInterfaceURI()
* @model
* @generated
*/
String getSwInterfaceURI();
/**
* Sets the value of the '{@link es.uah.aut.srg.micobs.mclev.library.mclevlibrary.MMCLEVVersionedItemComponent#getSwInterfaceURI <em>Sw Interface URI</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Sw Interface URI</em>' attribute.
* @see #getSwInterfaceURI()
* @generated
*/
void setSwInterfaceURI(String value);
/**
* Returns the value of the '<em><b>Sw Interface Version</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Sw Interface Version</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Sw Interface Version</em>' attribute.
* @see #setSwInterfaceVersion(String)
* @see es.uah.aut.srg.micobs.mclev.library.mclevlibrary.mclevlibraryPackage#getMMCLEVVersionedItemComponent_SwInterfaceVersion()
* @model
* @generated
*/
String getSwInterfaceVersion();
/**
* Sets the value of the '{@link es.uah.aut.srg.micobs.mclev.library.mclevlibrary.MMCLEVVersionedItemComponent#getSwInterfaceVersion <em>Sw Interface Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Sw Interface Version</em>' attribute.
* @see #getSwInterfaceVersion()
* @generated
*/
void setSwInterfaceVersion(String value);
} | parraman/micobs | mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/library/mclevlibrary/MMCLEVVersionedItemComponent.java | Java | epl-1.0 | 4,916 | 37.716535 | 176 | 0.695484 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Commonly used controls" />
<meta name="DC.Relation" scheme="URI" content="Chunk654565996.html#GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB" />
<meta name="DC.Relation" scheme="URI" content="index.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-32E29020-1956-461A-B79A-1492E06049E7.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-94005A46-B4C6-4A30-A8E8-1B9C2D583D50.html" />
<meta name="DC.Relation" scheme="URI" content="GUID-29486886-CB54-4A83-AD6D-70F971A86DFC.html" />
<meta name="DC.Relation" scheme="URI" content="Chunk1219618379.html#GUID-0F593BE1-1220-4403-B04E-B8E8A9A49701" />
<meta name="DC.Relation" scheme="URI" content="Chunk654565996.html#GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-F3262DF6-39CA-4E96-AD0E-C1FFDE9B0A61" />
<meta name="DC.Language" content="en" />
<link rel="stylesheet" type="text/css" href="commonltr.css" />
<title>
Commonly used controls
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="nokiacxxref.css" />
</head>
<body id="GUID-F3262DF6-39CA-4E96-AD0E-C1FFDE9B0A61">
<a name="GUID-F3262DF6-39CA-4E96-AD0E-C1FFDE9B0A61">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2470542 id2469732 id2469667 id2469361 id2469325 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
<a href="GUID-32E29020-1956-461A-B79A-1492E06049E7.html" title="The Symbian Guide describes the architecture and functionality of the platform, and provides guides on using its APIs.">
Symbian Guide
</a>
>
<a href="GUID-94005A46-B4C6-4A30-A8E8-1B9C2D583D50.html">
Classic UI Guide
</a>
>
<a href="GUID-29486886-CB54-4A83-AD6D-70F971A86DFC.html">
Application and UI frameworks
</a>
>
<a href="Chunk1219618379.html#GUID-0F593BE1-1220-4403-B04E-B8E8A9A49701">
UI concepts
</a>
>
<a href="Chunk654565996.html#GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB">
Controls
</a>
>
</div>
<h1 class="topictitle1">
Commonly
used controls
</h1>
<div>
<p>
The Symbian platform provides AVKON controls, which are a convenient
set of UI components designed specifically for devices based on the Symbian
platform.
</p>
<p>
Commonly used AVKON controls include:
</p>
<ul>
<li>
<p>
<a href="specs/guides/Dialogs_API_Specification/Dialogs_API_Specification.html" target="_blank">
dialogs
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Editors_API_Specification/Editors_API_Specification.html" target="_blank">
editors
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Form_API_Specification/Form_API_Specification.html" target="_blank">
forms
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Grids_API_Specification/Grids_API_Specification.html" target="_blank">
grids
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Lists_API_Specification/Lists_API_Specification.html" target="_blank">
lists
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Notes_API_Specification/Notes_API_Specification.html" target="_blank">
notes
</a>
</p>
</li>
<li>
<p>
<a href="specs/guides/Popups_API_Specification/Popups_API_Specification.html" target="_blank">
pop-up
lists
</a>
</p>
</li>
<li>
<p>
queries
</p>
</li>
<li>
<p>
<a href="specs/guides/Setting_Pages_API_Specification/Setting_Pages_API_Specification.html" target="_blank">
setting
pages
</a>
</p>
</li>
</ul>
<p>
All of the AVKON resources listed above, except dialogs, queries and
notes, are non-window-owning controls. This means that they cannot exist on
the screen without being inside another
<a href="Chunk654565996.html">
control
</a>
.
</p>
<div class="note">
<span class="notetitle">
Note:
</span>
<p>
Since AVKON UI resources scale automatically according to screen resolution
and orientation, it is recommended that you consider using AVKON or AVKON-derived
components in your application UI as they may require less implementation
effort. Custom
<a href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.html">
<span class="apiname">
CCoeControl
</span>
</a>
-derived controls may require
additional efforts to support
<a href="Chunk1925002978.html">
scalability
</a>
and
<a href="Chunk1313030609.html">
themes
</a>
.
</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink">
<strong>
Parent topic:
</strong>
<a href="Chunk654565996.html#GUID-5944FFF1-79C6-4F5E-95C8-F4833AFC64AB">
Controls
</a>
</div>
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/Chunk2145327219.html | HTML | epl-1.0 | 7,064 | 31.557604 | 189 | 0.616931 | false |
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright 2010" />
<meta name="DC.rights.owner" content="(C) Copyright 2010" />
<meta name="DC.Type" content="cxxClass" />
<meta name="DC.Title" content="CPtiKeyMapDataFactory" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C" />
<title>
CPtiKeyMapDataFactory
</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api" />
<link rel="stylesheet" type="text/css" href="cxxref.css" />
</head>
<body class="cxxref" id="GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C">
<a name="GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C">
<!-- -->
</a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">
Collapse all
</a>
<a id="index" href="index.html">
Symbian^3 Application Developer Library
</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1">
 
</div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2518338 id2518347 id2420140 id2406431 id2406544 id2406641 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb">
<a href="index.html" title="Symbian^3 Application Developer Library">
Symbian^3 Application Developer Library
</a>
>
</div>
<h1 class="topictitle1">
CPtiKeyMapDataFactory Class Reference
</h1>
<table class="signature">
<tr>
<td>
class CPtiKeyMapDataFactory : public CBase
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Keymap data factory class.
</p>
</div>
</div>
<div class="section derivation">
<h2 class="sectiontitle">
Inherits from
</h2>
<ul class="derivation derivation-root">
<li class="derivation-depth-0 ">
CPtiKeyMapDataFactory
<ul class="derivation">
<li class="derivation-depth-1 ">
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase
</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="section member-index">
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Public Member Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="code">
</td>
<td>
<a href="#GUID-EF092D24-2B1E-3D23-81C3-31B1E73301C5">
~CPtiKeyMapDataFactory
</a>
()
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
IMPORT_C
<a href="GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C.html">
CPtiKeyMapDataFactory
</a>
*
</td>
<td>
<a href="#GUID-23419E77-D69E-3224-8B2E-4D89684DE60C">
CreateImplementationL
</a>
(const
<a href="GUID-530281E6-29FC-33F2-BC9B-610FBA389444.html">
TUid
</a>
)
</td>
</tr>
<tr>
<td align="right" class="code">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-5170B5FB-7C5F-3AFD-B002-F0327DD93DD5">
ImplementationUid
</a>
()
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
<a href="GUID-670B1750-7C1F-3DB3-9635-C255F9D3E08D.html">
MPtiKeyMapData
</a>
*
</td>
<td>
<a href="#GUID-EC0769C2-FE34-3CFD-948C-D9EE5A799D00">
KeyMapDataForLanguageL
</a>
(
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
)
</td>
</tr>
<tr>
<td align="right" class="code">
IMPORT_C void
</td>
<td>
<a href="#GUID-A241E73E-A311-311C-B271-9DF46673CAFE">
ListImplementationsL
</a>
(
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> &)
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
void
</td>
<td>
<a href="#GUID-C4355AEF-68DD-34B9-A008-84BEB1C61696">
ListLanguagesL
</a>
(
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> &)
</td>
</tr>
<tr>
<td align="right" class="code">
IMPORT_C void
</td>
<td>
<a href="#GUID-7BC9394A-F0A4-323A-B2F6-69AB5090A353">
Reserved_1
</a>
()
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
IMPORT_C void
</td>
<td>
<a href="#GUID-84B9F5A6-20CE-3596-9BFC-FFD93679E105">
Reserved_2
</a>
()
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Private Member Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" class="code">
void
</td>
<td>
<a href="#GUID-EAB64EA6-597C-373C-9DCA-7F4D1ED721DA">
SetDestructorKeyId
</a>
(
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
)
</td>
</tr>
<tr class="bg">
<td align="right" class="code">
void
</td>
<td>
<a href="#GUID-B2A96013-7D7C-34F6-AA7A-0EF3A9FC4A87">
SetImplementationUid
</a>
(
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
)
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Inherited Functions
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::CBase()
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::Delete(CBase *)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::Extension_(TUint,TAny *&,TAny *)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TAny *)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TLeave)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TLeave,TUint)
</a>
</td>
</tr>
<tr class="bg">
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::operator new(TUint,TUint)
</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
<a href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.html">
CBase::~CBase()
</a>
</td>
</tr>
</tbody>
</table>
<table border="0" class="member-index">
<thead>
<tr>
<th colspan="2">
Private Attributes
</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-248752D2-78D5-3D4C-9669-003664FE8370">
iDTorId
</a>
</td>
</tr>
<tr class="bg">
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-918F3835-B3D0-34D8-A23C-EA33DCF87892">
iImplUid
</a>
</td>
</tr>
<tr>
<td align="right" valign="top">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
<a href="#GUID-425BEFBE-639E-33F5-B1C3-83CFF34AE854">
iReserved
</a>
</td>
</tr>
</tbody>
</table>
</div>
<h1 class="pageHeading topictitle1">
Constructor & Destructor Documentation
</h1>
<div class="nested1" id="GUID-EF092D24-2B1E-3D23-81C3-31B1E73301C5">
<a name="GUID-EF092D24-2B1E-3D23-81C3-31B1E73301C5">
<!-- -->
</a>
<h2 class="topictitle2">
~CPtiKeyMapDataFactory()
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C
</td>
<td>
~CPtiKeyMapDataFactory
</td>
<td>
(
</td>
<td>
)
</td>
<td>
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<h1 class="pageHeading topictitle1">
Member Functions Documentation
</h1>
<div class="nested1" id="GUID-23419E77-D69E-3224-8B2E-4D89684DE60C">
<a name="GUID-23419E77-D69E-3224-8B2E-4D89684DE60C">
<!-- -->
</a>
<h2 class="topictitle2">
CreateImplementationL(const TUid)
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C
<a href="GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C.html">
CPtiKeyMapDataFactory
</a>
*
</td>
<td>
CreateImplementationL
</td>
<td>
(
</td>
<td>
const
<a href="GUID-530281E6-29FC-33F2-BC9B-610FBA389444.html">
TUid
</a>
</td>
<td>
aImplUid
</td>
<td>
)
</td>
<td>
[static]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Creates a key map data instance for given implementation uid.
</p>
<div class="p">
<dl class="since">
<dt class="dlterm">
Since
</dt>
<dd>
S60 V5.0
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
const
<a href="GUID-530281E6-29FC-33F2-BC9B-610FBA389444.html">
TUid
</a>
aImplUid
</td>
<td>
An implemenation uid for key map data factory to be created.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-5170B5FB-7C5F-3AFD-B002-F0327DD93DD5">
<a name="GUID-5170B5FB-7C5F-3AFD-B002-F0327DD93DD5">
<!-- -->
</a>
<h2 class="topictitle2">
ImplementationUid()
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
ImplementationUid
</td>
<td>
(
</td>
<td>
)
</td>
<td>
const [inline]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-EC0769C2-FE34-3CFD-948C-D9EE5A799D00">
<a name="GUID-EC0769C2-FE34-3CFD-948C-D9EE5A799D00">
<!-- -->
</a>
<h2 class="topictitle2">
KeyMapDataForLanguageL(TInt)
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-670B1750-7C1F-3DB3-9635-C255F9D3E08D.html">
MPtiKeyMapData
</a>
*
</td>
<td>
KeyMapDataForLanguageL
</td>
<td>
(
</td>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
aLanguageCode
</td>
<td>
)
</td>
<td>
[pure virtual]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Returns keymap data object for given language.
</p>
<div class="p">
<dl class="since">
<dt class="dlterm">
Since
</dt>
<dd>
S60 5.0
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
aLanguageCode
</td>
<td>
Languace code for requested data.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-A241E73E-A311-311C-B271-9DF46673CAFE">
<a name="GUID-A241E73E-A311-311C-B271-9DF46673CAFE">
<!-- -->
</a>
<h2 class="topictitle2">
ListImplementationsL(RArray< TInt > &)
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C void
</td>
<td>
ListImplementationsL
</td>
<td>
(
</td>
<td>
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> &
</td>
<td>
aResult
</td>
<td>
)
</td>
<td>
[static]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Fills given list with implementation uids of all found key map data factory implementations.
</p>
<div class="p">
<dl class="since">
<dt class="dlterm">
Since
</dt>
<dd>
S60 V5.0
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> & aResult
</td>
<td>
An array to be filled with uids.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-C4355AEF-68DD-34B9-A008-84BEB1C61696">
<a name="GUID-C4355AEF-68DD-34B9-A008-84BEB1C61696">
<!-- -->
</a>
<h2 class="topictitle2">
ListLanguagesL(RArray< TInt > &)
</h2>
<table class="signature">
<tr>
<td>
void
</td>
<td>
ListLanguagesL
</td>
<td>
(
</td>
<td>
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> &
</td>
<td>
aResult
</td>
<td>
)
</td>
<td>
[pure virtual]
</td>
</tr>
</table>
<div class="section">
<div>
<p>
Lists all languages supported by this data factory.
</p>
<div class="p">
<dl class="since">
<dt class="dlterm">
Since
</dt>
<dd>
S60 5.0
</dd>
</dl>
</div>
</div>
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.html">
RArray
</a>
<
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
> & aResult
</td>
<td>
List instance for storing results.
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-7BC9394A-F0A4-323A-B2F6-69AB5090A353">
<a name="GUID-7BC9394A-F0A4-323A-B2F6-69AB5090A353">
<!-- -->
</a>
<h2 class="topictitle2">
Reserved_1()
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C void
</td>
<td>
Reserved_1
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[virtual]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-84B9F5A6-20CE-3596-9BFC-FFD93679E105">
<a name="GUID-84B9F5A6-20CE-3596-9BFC-FFD93679E105">
<!-- -->
</a>
<h2 class="topictitle2">
Reserved_2()
</h2>
<table class="signature">
<tr>
<td>
IMPORT_C void
</td>
<td>
Reserved_2
</td>
<td>
(
</td>
<td>
)
</td>
<td>
[virtual]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-EAB64EA6-597C-373C-9DCA-7F4D1ED721DA">
<a name="GUID-EAB64EA6-597C-373C-9DCA-7F4D1ED721DA">
<!-- -->
</a>
<h2 class="topictitle2">
SetDestructorKeyId(TInt)
</h2>
<table class="signature">
<tr>
<td>
void
</td>
<td>
SetDestructorKeyId
</td>
<td>
(
</td>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
aUid
</td>
<td>
)
</td>
<td>
[private, inline]
</td>
</tr>
</table>
<div class="section">
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
aUid
</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<div class="nested1" id="GUID-B2A96013-7D7C-34F6-AA7A-0EF3A9FC4A87">
<a name="GUID-B2A96013-7D7C-34F6-AA7A-0EF3A9FC4A87">
<!-- -->
</a>
<h2 class="topictitle2">
SetImplementationUid(TInt)
</h2>
<table class="signature">
<tr>
<td>
void
</td>
<td>
SetImplementationUid
</td>
<td>
(
</td>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
aUid
</td>
<td>
)
</td>
<td>
[private, inline]
</td>
</tr>
</table>
<div class="section">
</div>
<div class="section parameters">
<h3 class="sectiontitle">
Parameters
</h3>
<table border="0" class="parameters">
<tr>
<td class="parameter">
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
aUid
</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h1 class="pageHeading topictitle1">
Member Data Documentation
</h1>
<div class="nested1" id="GUID-248752D2-78D5-3D4C-9669-003664FE8370">
<a name="GUID-248752D2-78D5-3D4C-9669-003664FE8370">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iDTorId
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iDTorId
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-918F3835-B3D0-34D8-A23C-EA33DCF87892">
<a name="GUID-918F3835-B3D0-34D8-A23C-EA33DCF87892">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iImplUid
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iImplUid
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<div class="nested1" id="GUID-425BEFBE-639E-33F5-B1C3-83CFF34AE854">
<a name="GUID-425BEFBE-639E-33F5-B1C3-83CFF34AE854">
<!-- -->
</a>
<h2 class="topictitle2">
TInt
iReserved
</h2>
<table class="signature">
<tr>
<td>
<a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">
TInt
</a>
</td>
<td>
iReserved
</td>
<td>
[private]
</td>
</tr>
</table>
<div class="section">
</div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | sdk/GUID-52D2FA0B-F2BB-336B-AAA3-53BAAB9CDC7C.html | HTML | epl-1.0 | 23,488 | 21.827017 | 163 | 0.465855 | false |
package org.eclipse.scout.widgets.heatmap.client.ui.form.fields.heatmapfield;
import java.util.Collection;
import org.eclipse.scout.rt.client.ui.form.fields.IFormField;
public interface IHeatmapField extends IFormField {
String PROP_VIEW_PARAMETER = "viewParameter";
String PROP_HEAT_POINT_LIST = "heatPointList";
HeatmapViewParameter getViewParameter();
Collection<HeatPoint> getHeatPoints();
void handleClick(MapPoint point);
void addHeatPoint(HeatPoint heatPoint);
void addHeatPoints(Collection<HeatPoint> heatPoints);
void setHeatPoints(Collection<HeatPoint> heatPoints);
void setViewParameter(HeatmapViewParameter parameter);
IHeatmapFieldUIFacade getUIFacade();
void addHeatmapListener(IHeatmapListener listener);
void removeHeatmapListener(IHeatmapListener listener);
}
| BSI-Business-Systems-Integration-AG/org.thethingsnetwork.zrh.monitor | ttn_monitor/org.eclipse.scout.widgets.heatmap.client/src/main/java/org/eclipse/scout/widgets/heatmap/client/ui/form/fields/heatmapfield/IHeatmapField.java | Java | epl-1.0 | 817 | 23.757576 | 77 | 0.802938 | false |
/*
* Copyright (c) 2015 Cisco Systems, Inc. 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
*/
package org.opendaylight.protocol.bgp.linkstate.nlri;
import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv4Address;
import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv6Address;
import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeShort;
import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedShort;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.NlriType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.destination.CLinkstateDestination;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.TeLspCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.TeLspCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.te.lsp._case.AddressFamily;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.te.lsp._case.address.family.Ipv4Case;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.te.lsp._case.address.family.Ipv4CaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.te.lsp._case.address.family.Ipv6Case;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.object.type.te.lsp._case.address.family.Ipv6CaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.LspId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.TunnelId;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@VisibleForTesting
public final class TeLspNlriParser {
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier LSP_ID = new YangInstanceIdentifier.NodeIdentifier(
QName.create(CLinkstateDestination.QNAME, "lsp-id").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier TUNNEL_ID = new YangInstanceIdentifier.NodeIdentifier(
QName.create(CLinkstateDestination.QNAME, "tunnel-id").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV4_TUNNEL_SENDER_ADDRESS = new YangInstanceIdentifier.NodeIdentifier(
QName.create(CLinkstateDestination.QNAME, "ipv4-tunnel-sender-address").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV4_TUNNEL_ENDPOINT_ADDRESS = new YangInstanceIdentifier
.NodeIdentifier(QName.create(CLinkstateDestination.QNAME, "ipv4-tunnel-endpoint-address").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV6_TUNNEL_SENDER_ADDRESS = new YangInstanceIdentifier
.NodeIdentifier( QName.create(CLinkstateDestination.QNAME, "ipv6-tunnel-sender-address").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV6_TUNNEL_ENDPOINT_ADDRESS = new YangInstanceIdentifier
.NodeIdentifier(QName.create(CLinkstateDestination.QNAME, "ipv6-tunnel-endpoint-address").intern());
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV4_CASE = new YangInstanceIdentifier.NodeIdentifier(Ipv4Case.QNAME);
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier IPV6_CASE = new YangInstanceIdentifier.NodeIdentifier(Ipv6Case.QNAME);
@VisibleForTesting
public static final YangInstanceIdentifier.NodeIdentifier ADDRESS_FAMILY = new YangInstanceIdentifier.NodeIdentifier(AddressFamily.QNAME);
private TeLspNlriParser() {
throw new UnsupportedOperationException();
}
public static NlriType serializeIpvTSA(final AddressFamily addressFamily, final ByteBuf body) {
if (addressFamily.equals(Ipv6Case.class)) {
final Ipv6Address ipv6 = ((Ipv6Case) addressFamily).getIpv6TunnelSenderAddress();
Preconditions.checkArgument(ipv6 != null, "Ipv6TunnelSenderAddress is mandatory.");
writeIpv6Address(ipv6, body);
return NlriType.Ipv6TeLsp;
}
final Ipv4Address ipv4 = ((Ipv4Case) addressFamily).getIpv4TunnelSenderAddress();
Preconditions.checkArgument(ipv4 != null, "Ipv4TunnelSenderAddress is mandatory.");
writeIpv4Address(ipv4, body);
return NlriType.Ipv4TeLsp;
}
public static void serializeTunnelID(final TunnelId tunnelID, final ByteBuf body) {
Preconditions.checkArgument(tunnelID != null, "TunnelId is mandatory.");
writeUnsignedShort(tunnelID.getValue(), body);
}
public static void serializeLspID(final LspId lspId, final ByteBuf body) {
Preconditions.checkArgument(lspId != null, "LspId is mandatory.");
writeShort(lspId.getValue().shortValue(), body);
}
public static void serializeTEA(final AddressFamily addressFamily, final ByteBuf body) {
if (addressFamily.equals(Ipv6Case.class)) {
final Ipv6Address ipv6 = ((Ipv6Case) addressFamily).getIpv6TunnelEndpointAddress();
Preconditions.checkArgument(ipv6 != null, "Ipv6TunnelEndpointAddress is mandatory.");
writeIpv6Address(ipv6, body);
return;
}
final Ipv4Address ipv4 = ((Ipv4Case) addressFamily).getIpv4TunnelEndpointAddress();
Preconditions.checkArgument(ipv4 != null, "Ipv4TunnelEndpointAddress is mandatory.");
Preconditions.checkArgument(ipv4 != null, "Ipv4TunnelEndpointAddress is mandatory.");
writeIpv4Address(ipv4, body);
}
public static TeLspCase serializeTeLsp(final ContainerNode containerNode) {
final TeLspCaseBuilder teLspCase = new TeLspCaseBuilder();
teLspCase.setLspId(new LspId((Long) containerNode.getChild(LSP_ID).get().getValue()));
teLspCase.setTunnelId(new TunnelId((Integer) containerNode.getChild(TUNNEL_ID).get().getValue()));
if(containerNode.getChild(ADDRESS_FAMILY).isPresent()) {
final ChoiceNode addressFamily = (ChoiceNode) containerNode.getChild(ADDRESS_FAMILY).get();
if(addressFamily.getChild(IPV4_CASE).isPresent()) {
teLspCase.setAddressFamily(serializeAddressFamily((ContainerNode) addressFamily.getChild(IPV4_CASE)
.get(), true));
}else{
teLspCase.setAddressFamily(serializeAddressFamily((ContainerNode) addressFamily.getChild(IPV6_CASE)
.get(), false));
}
}
return teLspCase.build();
}
private static AddressFamily serializeAddressFamily(final ContainerNode containerNode, final boolean ipv4Case) {
if(ipv4Case) {
return new Ipv4CaseBuilder()
.setIpv4TunnelSenderAddress(new Ipv4Address((String) containerNode.getChild(IPV4_TUNNEL_SENDER_ADDRESS).get().getValue()))
.setIpv4TunnelEndpointAddress(new Ipv4Address((String) containerNode.getChild(IPV4_TUNNEL_ENDPOINT_ADDRESS).get().getValue()))
.build();
}
return new Ipv6CaseBuilder()
.setIpv6TunnelSenderAddress(new Ipv6Address((String) containerNode.getChild(IPV6_TUNNEL_SENDER_ADDRESS).get().getValue()))
.setIpv6TunnelEndpointAddress(new Ipv6Address((String) containerNode.getChild(IPV6_TUNNEL_ENDPOINT_ADDRESS).get().getValue()))
.build();
}
}
| inocybe/odl-bgpcep | bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/nlri/TeLspNlriParser.java | Java | epl-1.0 | 8,515 | 60.258993 | 162 | 0.76007 | false |
/**
*/
package WTSpec4M.presentation;
import org.eclipse.emf.common.ui.URIEditorInput;
import org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.util.EditUIUtil;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.mondo.collaboration.online.rap.widgets.CurrentUserView;
import org.mondo.collaboration.online.rap.widgets.DefaultPerspectiveAdvisor;
import org.mondo.collaboration.online.rap.widgets.ModelExplorer;
import org.mondo.collaboration.online.rap.widgets.ModelLogView;
import org.mondo.collaboration.online.rap.widgets.WhiteboardChatView;
/**
* Customized {@link WorkbenchAdvisor} for the RCP application.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public final class WTSpec4MEditorAdvisor extends WorkbenchAdvisor {
/**
* This looks up a string in the plugin's plugin.properties file.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static String getString(String key) {
return WTSpec4MEditorPlugin.INSTANCE.getString(key);
}
/**
* This looks up a string in plugin.properties, making a substitution.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static String getString(String key, Object s1) {
return WTSpec4M.presentation.WTSpec4MEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
}
/**
* RCP's application
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class Application implements IApplication {
/**
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object start(IApplicationContext context) throws Exception {
WorkbenchAdvisor workbenchAdvisor = new WTSpec4MEditorAdvisor();
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
}
else {
return IApplication.EXIT_OK;
}
}
finally {
display.dispose();
}
}
/**
* @see org.eclipse.equinox.app.IApplication#stop()
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void stop() {
// Do nothing.
}
}
/**
* RCP's perspective
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class Perspective implements IPerspectiveFactory {
/**
* Perspective ID
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String ID_PERSPECTIVE = "WTSpec4M.presentation.WTSpec4MEditorAdvisorPerspective";
/**
* @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createInitialLayout(IPageLayout layout) {
layout.setEditorAreaVisible(true);
layout.addPerspectiveShortcut(ID_PERSPECTIVE);
IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float)0.33, layout.getEditorArea());
left.addView(ModelExplorer.ID);
IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, (float)0.90, "left");
bottomLeft.addView(CurrentUserView.ID);
IFolderLayout topRight = layout.createFolder("topRight", IPageLayout.RIGHT, (float)0.55, layout.getEditorArea());
topRight.addView(WhiteboardChatView.ID);
IFolderLayout right = layout.createFolder("right", IPageLayout.BOTTOM, (float)0.33, "topRight");
right.addView(ModelLogView.ID);
IFolderLayout bottomRight = layout.createFolder("bottomRight", IPageLayout.BOTTOM, (float)0.60, "right");
bottomRight.addView(IPageLayout.ID_PROP_SHEET);
}
}
/**
* RCP's window advisor
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class WindowAdvisor extends WorkbenchWindowAdvisor {
private Shell shell;
/**
* @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WindowAdvisor(IWorkbenchWindowConfigurer configurer) {
super(configurer);
}
@Override
public void createWindowContents(Shell shell) {
super.createWindowContents(shell);
this.shell = shell;
}
@Override
public void postWindowOpen() {
super.postWindowOpen();
shell.setMaximized(true);
DefaultPerspectiveAdvisor.hideDefaultViews();
}
/**
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
// configurer.setInitialSize(new Point(600, 450));
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(true);
configurer.setTitle(getString("_UI_Application_title"));
}
/**
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
return new WindowActionBarAdvisor(configurer);
}
}
/**
* RCP's action bar advisor
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class WindowActionBarAdvisor extends ActionBarAdvisor {
/**
* @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WindowActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
/**
* @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void fillMenuBar(IMenuManager menuBar) {
IWorkbenchWindow window = getActionBarConfigurer().getWindowConfigurer().getWindow();
menuBar.add(createFileMenu(window));
menuBar.add(createEditMenu(window));
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(createWindowMenu(window));
menuBar.add(createHelpMenu(window));
}
/**
* Creates the 'File' menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
/**
* Creates the 'Edit' menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createEditMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_Edit_label"),
IWorkbenchActionConstants.M_EDIT);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
menu.add(new Separator());
addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
/**
* Creates the 'Window' menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createWindowMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_Window_label"),
IWorkbenchActionConstants.M_WINDOW);
addToMenuAndRegister(menu, ActionFactory.OPEN_NEW_WINDOW.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
/**
* Creates the 'Help' menu.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createHelpMenu(IWorkbenchWindow window) {
IMenuManager menu = new MenuManager(getString("_UI_Menu_Help_label"), IWorkbenchActionConstants.M_HELP);
// Welcome or intro page would go here
// Help contents would go here
// Tips and tricks page would go here
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
/**
* Adds the specified action to the given menu and also registers the action with the
* action bar configurer, in order to activate its key binding.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addToMenuAndRegister(IMenuManager menuManager, IAction action) {
menuManager.add(action);
getActionBarConfigurer().registerGlobalAction(action);
}
}
/**
* About action for the RCP application.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class AboutAction extends WorkbenchWindowActionDelegate {
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void run(IAction action) {
MessageDialog.openInformation(getWindow().getShell(), getString("_UI_About_title"),
getString("_UI_About_text"));
}
}
/**
* Open URI action for the objects from the WTSpec4M model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static class OpenURIAction extends WorkbenchWindowActionDelegate {
/**
* Opens the editors for the files selected using the LoadResourceDialog.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void run(IAction action) {
LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog(getWindow().getShell());
if (Window.OK == loadResourceDialog.open()) {
for (URI uri : loadResourceDialog.getURIs()) {
openEditor(getWindow().getWorkbench(), uri);
}
}
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static boolean openEditor(IWorkbench workbench, URI uri) {
IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
IEditorDescriptor editorDescriptor = EditUIUtil.getDefaultEditor(uri, null);
if (editorDescriptor == null) {
MessageDialog.openError(
workbenchWindow.getShell(),
getString("_UI_Error_title"),
getString("_WARN_No_Editor", uri.lastSegment()));
return false;
}
else {
try {
page.openEditor(new URIEditorInput(uri), editorDescriptor.getId());
}
catch (PartInitException exception) {
MessageDialog.openError(
workbenchWindow.getShell(),
getString("_UI_OpenEditorError_label"),
exception.getMessage());
return false;
}
}
return true;
}
/**
* @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getInitialWindowPerspectiveId() {
return Perspective.ID_PERSPECTIVE;
}
/**
* @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
configurer.setSaveAndRestore(true);
}
/**
* @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new WindowAdvisor(configurer);
}
}
| mondo-project/mondo-demo-wt | MONDO-Collab/org.mondo.wt.cstudy.metamodel.online.editor/src/WTSpec4M/presentation/WTSpec4MEditorAdvisor.java | Java | epl-1.0 | 14,965 | 31.044968 | 136 | 0.713064 | false |
import java.sql.*;
public class ConnessioneDB {
static {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "calcio";
String userName = "root";
String password = "";
/*
String url = "jdbc:mysql://127.11.139.2:3306/";
String dbName = "sirio";
String userName = "adminlL8hBfI";
String password = "HPZjQCQsnVG4";
*/
public Connection openConnection(){
try {
conn = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connessione al DataBase stabilita!");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public void closeConnection(Connection conn){
try {
conn.close();
System.out.println(" Chiusa connessione al DB!");
}
catch (SQLException e) {
e.printStackTrace();
}
}
}
| nicolediana/progetto | ServletExample/src/ConnessioneDB.java | Java | epl-1.0 | 1,248 | 20.894737 | 68 | 0.661859 | false |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="copyright" content="(C) Copyright 2010"/>
<meta name="DC.rights.owner" content="(C) Copyright 2010"/>
<meta name="DC.Type" content="cxxStruct"/>
<meta name="DC.Title" content="NW_WBXML_DictEntry_s"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="GUID-96500C2E-AB23-3B72-9F5C-B3CDB907B7A1"/>
<title>NW_WBXML_DictEntry_s</title>
<link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/>
<!--[if IE]>
<link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<meta name="keywords" content="api"/><link rel="stylesheet" type="text/css" href="cxxref.css"/></head>
<body class="cxxref" id="GUID-96500C2E-AB23-3B72-9F5C-B3CDB907B7A1"><a name="GUID-96500C2E-AB23-3B72-9F5C-B3CDB907B7A1"><!-- --></a>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?>
<div id="sdl_container">
<div id="leftMenu">
<div id="expandcontractdiv">
<a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a>
<a id="index" href="index.html">Symbian^3 Product Developer Library</a>
</div>
<iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe>
<div id="treeDiv1"> </div>
<script type="text/javascript">
var currentIconMode = 0; window.name="id2437088 id2437096 id2366708 id2678541 id2678630 id2679019 ";
YAHOO.util.Event.onDOMReady(buildTree, this,true);
</script>
</div>
<div id="sdl_content">
<div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> ></div>
<h1 class="topictitle1">NW_WBXML_DictEntry_s Struct Reference</h1>
<table class="signature"><tr><td>struct NW_WBXML_DictEntry_s</td></tr></table><div class="section"></div>
<div class="section member-index"><table border="0" class="member-index"><thead><tr><th colspan="2">Public Attributes</th></tr></thead><tbody><tr><td align="right" valign="top">
<a href="GUID-AB88C0D1-3074-390C-AB9C-6F2CAF37358B.html">NW_String_UCS2Buff_t</a> *</td><td><a href="#GUID-6CDDAA87-2706-3B2C-AB3D-B7CA71F9ED9A">name</a></td></tr><tr class="bg"><td align="right" valign="top">
<a href="GUID-F3173C6F-3297-31CF-B82A-11B084BDCD68.html">NW_Byte</a>
</td><td><a href="#GUID-EF10F77C-BABC-30AB-A33D-3488F3F2E9A1">token</a></td></tr></tbody></table></div><h1 class="pageHeading topictitle1">Member Data Documentation</h1><div class="nested1" id="GUID-6CDDAA87-2706-3B2C-AB3D-B7CA71F9ED9A"><a name="GUID-6CDDAA87-2706-3B2C-AB3D-B7CA71F9ED9A"><!-- --></a>
<h2 class="topictitle2">
NW_String_UCS2Buff_t * name</h2>
<table class="signature"><tr><td>
<a href="GUID-AB88C0D1-3074-390C-AB9C-6F2CAF37358B.html">NW_String_UCS2Buff_t</a> *</td><td>name</td></tr></table><div class="section"></div>
</div>
<div class="nested1" id="GUID-EF10F77C-BABC-30AB-A33D-3488F3F2E9A1"><a name="GUID-EF10F77C-BABC-30AB-A33D-3488F3F2E9A1"><!-- --></a>
<h2 class="topictitle2">
NW_Byte
token</h2>
<table class="signature"><tr><td>
<a href="GUID-F3173C6F-3297-31CF-B82A-11B084BDCD68.html">NW_Byte</a>
</td><td>token</td></tr></table><div class="section"></div>
</div>
<p class="copyright">Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License
v1.0</a>.</p>
</div>
</div>
<?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?>
</body>
</html> | warlordh/fork_Symbian | pdk/GUID-96500C2E-AB23-3B72-9F5C-B3CDB907B7A1.html | HTML | epl-1.0 | 3,921 | 49.935065 | 305 | 0.68656 | false |