OC.Share={ SHARE_TYPE_USER:0, SHARE_TYPE_GROUP:1, SHARE_TYPE_LINK:3, SHARE_TYPE_EMAIL:4, itemShares:[], statuses:{}, droppedDown:false, /** * Loads ALL share statuses from server, stores them in OC.Share.statuses then * calls OC.Share.updateIcons() to update the files "Share" icon to "Shared" * according to their share status and share type. */ loadIcons:function(itemType) { // Load all share icons $.get(OC.filePath('core', 'ajax', 'share.php'), { fetch: 'getItemsSharedStatuses', itemType: itemType }, function(result) { if (result && result.status === 'success') { OC.Share.statuses = {}; $.each(result.data, function(item, data) { OC.Share.statuses[item] = data; }); OC.Share.updateIcons(itemType); } }); }, /** * Updates the files' "Share" icons according to the known * sharing states stored in OC.Share.statuses. * (not reloaded from server) */ updateIcons:function(itemType){ var item; for (item in OC.Share.statuses){ var data = OC.Share.statuses[item]; var hasLink = data['link']; // Links override shared in terms of icon display if (hasLink) { var image = OC.imagePath('core', 'actions/public'); } else { var image = OC.imagePath('core', 'actions/shared'); } if (itemType != 'file' && itemType != 'folder') { $('a.share[data-item="'+item+'"]').css('background', 'url('+image+') no-repeat center'); } else { var file = $('tr[data-id="'+item+'"]'); if (file.length > 0) { var action = $(file).find('.fileactions .action[data-action="Share"]'); var img = action.find('img').attr('src', image); action.addClass('permanent'); action.html(' '+t('core', 'Shared')+'').prepend(img); } else { var dir = $('#dir').val(); if (dir.length > 1) { var last = ''; var path = dir; // Search for possible parent folders that are shared while (path != last) { if (path == data['path'] && !data['link']) { var actions = $('.fileactions .action[data-action="Share"]'); $.each(actions, function(index, action) { var img = $(action).find('img'); if (img.attr('src') != OC.imagePath('core', 'actions/public')) { img.attr('src', image); $(action).addClass('permanent'); $(action).html(' '+t('core', 'Shared')+'').prepend(img); } }); } last = path; path = OC.Share.dirname(path); } } } } } }, updateIcon:function(itemType, itemSource) { var shares = false; var link = false; var image = OC.imagePath('core', 'actions/share'); $.each(OC.Share.itemShares, function(index) { if (OC.Share.itemShares[index]) { if (index == OC.Share.SHARE_TYPE_LINK) { if (OC.Share.itemShares[index] == true) { shares = true; image = OC.imagePath('core', 'actions/public'); link = true; return; } } else if (OC.Share.itemShares[index].length > 0) { shares = true; image = OC.imagePath('core', 'actions/shared'); } } }); if (itemType != 'file' && itemType != 'folder') { $('a.share[data-item="'+itemSource+'"]').css('background', 'url('+image+') no-repeat center'); } else { var file = $('tr').filterAttr('data-id', String(itemSource)); if (file.length > 0) { var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); var img = action.find('img').attr('src', image); if (shares) { action.addClass('permanent'); action.html(' '+ escapeHTML(t('core', 'Shared'))+'').prepend(img); } else { action.removeClass('permanent'); action.html(' '+ escapeHTML(t('core', 'Share'))+'').prepend(img); } } } if (shares) { OC.Share.statuses[itemSource] = OC.Share.statuses[itemSource] || {}; OC.Share.statuses[itemSource]['link'] = link; } else { delete OC.Share.statuses[itemSource]; } }, loadItem:function(itemType, itemSource) { var data = ''; var checkReshare = true; if (typeof OC.Share.statuses[itemSource] === 'undefined') { // NOTE: Check does not always work and misses some shares, fix later var checkShares = true; } else { var checkShares = true; } $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkReshare: checkReshare, checkShares: checkShares }, async: false, success: function(result) { if (result && result.status === 'success') { data = result.data; } else { data = false; } }}); return data; }, share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, callback) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'share', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith, permissions: permissions, itemSourceName: itemSourceName }, function (result) { if (result && result.status === 'success') { if (callback) { callback(result.data); } } else { if (result.data && result.data.message) { var msg = result.data.message; } else { var msg = t('core', 'Error'); } OC.dialogs.alert(msg, t('core', 'Error while sharing')); } }); }, unshare:function(itemType, itemSource, shareType, shareWith, callback) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'unshare', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith }, function(result) { if (result && result.status === 'success') { if (callback) { callback(); } } else { OC.dialogs.alert(t('core', 'Error while unsharing'), t('core', 'Error')); } }); }, setPermissions:function(itemType, itemSource, shareType, shareWith, permissions) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setPermissions', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith, permissions: permissions }, function(result) { if (!result || result.status !== 'success') { OC.dialogs.alert(t('core', 'Error while changing permissions'), t('core', 'Error')); } }); }, showDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) { var data = OC.Share.loadItem(itemType, itemSource); var dropDownEl; var html = '
---
title: Support for IDEs
order: 3
layout: page
---
[[intro.ide]]
= Support for IDEs
While Vaadin is not bound to any specific IDE, and you can in fact easily use it
without any IDE altogether, we provide special support for the Eclipse IDE, IntelliJ IDEA, and the NetBeans IDE, which have become the most used environment for Java development.
An official Vaadin plug-in is available for the Eclipse and NetBeans IDEs.
It helps in:
* creating new Vaadin projects,
* creating custom themes,
* creating custom client-side widgets,
* downloading add-ons from the Vaadin directory, and
* easily upgrading to a newer version of the Vaadin library.
Availability of the features depends on the IDE.
The ultimate edition of IntelliJ IDEA comes with built-in support for Vaadin.
*_Vaadin Designer_* is a commercial plug-in available for the Eclipse IDE and IntelliJ IDEA.
It enables visual editing of declarative designs that you can use in your applications.
See <<dummy/../../../designer/designer-overview#designer.overview, "Vaadin Designer">> for more information.
Using the Vaadin plug-in is the recommended way of installing Vaadin for development.
Installing the IDEs and the plug-ins is covered in <<dummy/../../../framework/installing/installing-overview#installing, "Installing Development Tools">>.
The creation of a new Vaadin project with each IDE is covered in <<dummy/../../../framework/getting-started/getting-started-first-project#getting-started.overview, "Creating a Vaadin Project">>.